Page 1 of 1

Run Notepad to display text file

Posted: Sat Jan 14, 2017 1:48 am
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?

Run Notepad to display text file

Posted: Sat Jan 14, 2017 2:25 am
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 ...

Re: Run Notepad to display text file

Posted: Mon Jan 16, 2017 4:58 am
by RussBaker
Gracias Pablo.

That was exactly the problem. It is working now.

--Russ