Reading what you wrote

Reading has some rather strange commands. To read info from a file, you have to read it into a variable, such as a string or integer. To do this, open the file, using the same code as when you would write to a file, but change the word output to input. Here's what I mean:

open "c:\your\file\name\filename.ext" for input as #1

Now, to read from the file you just opened, use the following code:

input #1, yourvariable

That reads the first group of letters, numbers, etc before the first comma to the variable 'yourvariable'. To read to two variables, you put a comma in between the two variables like this:

input #1, yourvariable, yourvariable2

The above code reads the characters before the comma to 'yourvariable', and the characters after the comma to 'yourvariable2'. You can do this an unlimited number of times. That's about all there is to it.

Back to the Tutorials...

Email: cybertron@flashmail.com