Page 1 of 1

OPENING A FILE TO SAVE RESULTS

Posted: Thu May 26, 2011 9:22 am
by LEGRAND
This one probaly easy,but I don't find the way. My files opened, with instruction OPEN "O",#1 ,"***" but I don't never know ...where, I mean in what folder. To assure it will open in "my documents" for instance, what is the correct instruction?
2. How to do to avoid repeating lines you want to see to appear both on screen and in the file your program opened:
PRINT "WHATEVER"
PRINT#1,"WHATEVER"
and even a third time on the printer:
LPRINT"WHATEVER"
Is there a way to get it with only one instruction?
Thanks for help.

Posted: Thu May 26, 2011 10:03 am
by burger2227
You can either move the program to the path folder or use a path from the root of the drive in the OPEN statement. The root would most likely be "C:\MyDocu~1\filename.txt"

Why do all three things at once? You are gonna waste a lot of paper and ink if you print everything at once. What I would do is PRINT it to the screen and PRINT # it to a file. Maybe preview it before printing the file.

Save the text to an array and make SUB procedures to do the work. Each can be chosen from a simple menu. All three procedures can use USING to work with formatted text. Does LPRINT work for you? You may need to set up a Network printer.

Create the text file first and use SHELL to open it in Notepad. Then PRINT it using Notepad or SHELL

SHELL "CMD /C START Notepad ABC.txt" 'preview

SHELL "CMD /C START /min Notepad /p ABC.txt" 'printer

Ted

OPENING QB FILE

Posted: Thu May 26, 2011 10:39 am
by LEGRAND
Looks fine.Thanks.
By the way, yes, my LPRINT works.