avatar_Audronic

Noob Help - How to display a text file on the screen (Basic)

Started by Audronic, 01:23, 27 June 15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Audronic

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


Procrastinators Unite,
If it Ain't Broke PLEASE Don't Fix it.
I keep telling you I am Not Pedantic.

mahlemiut

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.
- Barry Rodewald

ronaldo

As @mahlemiut 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 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 :).

Audronic

@ mahlemuit  and ronaldo


Thanks for the info.
I will use CPM to type the file.

Thanks chaps       Ray
Procrastinators Unite,
If it Ain't Broke PLEASE Don't Fix it.
I keep telling you I am Not Pedantic.

ZbyniuR

@Audronic - There is on ZIP/DSK file my program  '0.bas'
Just for Fun: C64 roms v2
It's easy starter that shows TXT files. Maybe you'll like it. :)
In STARS, TREK is better than WARS.

Powered by SMFPacks Menu Editor Mod