Run Notepad to display text file

Moderator: Rathinagiri

Post Reply
User avatar
RussBaker
Posts: 51
Joined: Wed Jul 22, 2015 9:44 am

Run Notepad to display text file

Post by RussBaker »

This should be easy, but I'm having trouble.
My code is

RUN ( "NOTEPAD" + "report.TXT" )

I want to display my report.txt in notepad after it's generated and wait for the user to close it.

Why doesn't this work?

Is there a simple way to display a text file in HMG?
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Run Notepad to display text file

Post by Pablo César »

RussBaker wrote: Sat Jan 14, 2017 1:48 am This should be easy, but I'm having trouble.
My code is

RUN ( "NOTEPAD" + "report.TXT" )

I want to display my report.txt in notepad after it's generated and wait for the user to close it.

Why doesn't this work?
Hi Russ,

It did not work because it is simply missing a space character between NOTEPAD and its filename.

RUN ( "NOTEPAD" + " report.TXT" ) // check if report.TXT is in the current folder (same folder than executable's folder)

There is better use with:

EXECUTE FILE "report.TXT"

Sometimes we hit our heads and find no solution, and the mistake we made is well ahead of us ...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
RussBaker
Posts: 51
Joined: Wed Jul 22, 2015 9:44 am

Re: Run Notepad to display text file

Post by RussBaker »

Gracias Pablo.

That was exactly the problem. It is working now.

--Russ
Post Reply