Hi All
After reading the manual for 45 minutes I am here.
i wish to read a File " -readme.txt " on a DSK in an emulator. I am in basic.
I have exhausted all that i know.
What is the syntax to read the file to the screen???
Thanks Ray
Try the following program:
10 OPENIN "-readme.txt"
20 WHILE NOT EOF
30 INPUT #9,a$
40 print a$
50 WEND
60 CLOSEIN
(based on the example program for EOF in the 6128 manual)
Other options include the TYPE command in CP/M, FutureOS and X-DDOS (and maybe others too) have similar functions.
As @mahlemiut (http://www.cpcwiki.eu/forum/index.php?action=profile;u=89) says, there is no single BASIC command to read and type to screen the contents of an ASCII text file. They way to do it in BASIC is creating a simple program that opens the file, reads it and prints to screen. Extending what @mahlemiut (http://www.cpcwiki.eu/forum/index.php?action=profile;u=89) posted:
10 OPENIN "-readme.txt"
20 a$="-"
30 WHILE a$<>""
40 INPUT #9,a$
50 PRINT a$
60 WEND
That will open the file, read and print lines until no more lines are available :).
@ mahlemuit and ronaldo
Thanks for the info.
I will use CPM to type the file.
Thanks chaps Ray
@Audronic (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1169) - There is on ZIP/DSK file my program '0.bas'
Just for Fun: C64 roms v2 (http://www.cpcwiki.eu/forum/off-topic/just-for-fun-c64-roms-v2/msg95130/#msg95130)
It's easy starter that shows TXT files. Maybe you'll like it. :)