READ
Sequentially copies, to the given list of variables, the values found in DATA lines. Also used by some BASICs for reading the contents of a file.
Implemented by: dartmouth1, ansimin, ansifull, decbasic, Altair, Applesoft, TI994, CBM, Atari, msatari, trs80, level2, trscolor, colormc, spectrum, BBC, GWBASIC, MSX, bwbasic, bw32, ABasiC, QBasic, VBDOS, minibasicjs, EndBASIC
With variations: hptsb, tasc (numeric strings in DATA can be read into a numeric variable), FreeBASIC, Gambas
Also written as:
Usage
In Applesoft BASIC, READ filename
would open a sequential (text) file or a random-access file in a kind of stream mode: further INPUT and GET instructions would read from filename until a PRINT command containing a CTRL+D
control character was issued1).
- In the form
READ filename,pos
, input would start from byte pos of the sequential file. - In the form
READ filename,rec
, further input would start from record rec of the random-access file. - Optionally,
READ filename,rec,pos
would cause further input to be read from byte pos of record rec.