General Electric ASCII Sequential Files

Michael P. Guerard 7 South Jefferson Avenue Wenonah, NJ 80890

Mr. Richard Halloran'stipson using "terminal" files offers some interesting alternatives to data entry, but there is one bug in the process.

The problem is that if the first data value on a line is numerical, it becomes part of the line number, and is lost as a data value! Fortunately, this can be prevented by entering each line as a comment, beginning with a single quote ('). This has the added advantage of allowing the "file" to be RUN without errors (or output!), should one forget that it is not a "real" program.

Greater flexibility in data format can be achieved if LINEINPUT is used instead of INPUT; this allows any characters to be included in the data, even "quotes." Also, I recommend using line numbers from 1000; this allows quite a large file to be entered and keeps the number of characters to be stripped off the front of each line to fixed number. Allowing for the space after the line number, plus the comment quote (6 characters in all), the MID$(A$,7) function works nicely. After the line has been LINEINPUT, it can be broken up and manipulated as needed by the various string functions and VAL(). Of course, INPUT also works well if the data format is consistent from line to line.

0 0

Post a comment