Hi. This is me seeking code help again. I do usually look in manuals (which are vague and rarely provide examples). Then I try to backwards engineer other programs. Then I try to create my own small routines.
The READ command.
1) Usually I use OPEN / READ / CLOSE to get information from a text file. Works fine. However, I've noticed other programs seem to just use READ. For example,
"READ PROGRAM":INPUT A$
Can I just READ PROGRAM or do I need OPEN/READ/CLOSE?
2) Is it possible to read one certain variable from a text file? I've seen things like "READ PROGRAM,R" : INPUT A$ (without OPEN/CLOSE as above)
Lastly, how does READ work with DATA
3) I've tried various ways to read data. How does a simple read data work?
4) How do I read only certain portions of DATA. For instance if I have a list of, lets say, the 12 months of the year.
DATA "JANUARY", "FEBRUARY", "MARCH", "APRIL", and so on...
How can I read just the first three variables, and then later in the program read the second set of three months. Or read the first six months, and the later the last six months.
Linking with the second question, will that work with a TEXT file?
5) Data can be more than one line, correct? EG:
100 DATA "DOG","CAT","HORSE"
110 DATA "COW","PIG","RABBIT"
120 DATA "FROG", "MONKEY", "SEA CUCUMBER"
I don't have any examples for 5) as I'm trying to work out how to make more efficient programming. Except to say each line could contain 15 or so animals instead of three.
6) Data can be numbers and words?
100 DATA "DOG", 101, "CAT", 3.1415, "HORSE", 1962