Read a sequential file
GWBasic has a number of statements that open a file control
block for input and output of data. A file can be opened and displayed
by executing an input and displaying the contents with a print
statement. This is a tiny routine that will open a file for input and
display the output, byte at a time until the first Control Z is
detected. The Control Z byte with a value of 1A hexidecimal defines the
end of file. The read function terminates when an End of File is
detected.
Create a text file named scrap.txt
and display it
in ascii with the following program, one byte at a time. The program
terminates when it sees the End Of File byte, the control Z or binary
1A.
Summary
Link to the program and
copy-paste it into a text file so you can run it with the GWBasic
Interpreter.
Isn't it nice that all these programs are available in the set of
programs that have been provided with the Window's system? It isn't
even necessary to go out and purchase a bunch of applications to write
programs using the Windows system. Its all here.
Its just a matter of becoming familiar with their
operation.
In short.... play around and have fun......... Happy Hacking......