READ
READ var1 [, var2, …, varN]
Assigns values in DATA items to the specified variables
var1
to varN
. Unless a RESTORE command is
executed, SmallBASIC moves to the next DATA item with each READ
assignment. If SmallBASIC runs out of DATA items to read, an run-time
error occurs.
See DATA and RESTORE for more information.
Example 1: READ with one variable
FOR c = 1 TO 6
READ x
PRINT x
NEXT
DATA "a,b,c", 2
DATA 3, 4
DATA "fifth", 6
Example 2: READ with two variables
FOR c = 1 TO 3
READ x, y
PRINT x, y
NEXT
DATA "a,b,c", 2
DATA 3, 4
DATA "fifth", 6
Code samples using READ
001 3 ways to print hello 5 times.bas
003 conditional branching.bas
004 loops.bas
006 arrays+.bas
3d wire cube v1.bas
3d wire cube.bas
3dtictac.bas
3dttt.bas
3dttt.bas
7gables.bas
anomail.bas
Balleta 2-11-15.bas
BAS_1968.bas
BAS_NOW.bas
betrayal: crows ii.bas
blackbox.bas
Blackbox.bas
bolmo.bas
Calendar.bas
calendar.bas
conrec-sb-v01.bas
crow.bas
cube3d.bas
dataminmax.bas
dogstar5.bas
Eliza.bas
eliza.bas
evdemo.bas
falling blocks - tetris.bas
Data
APPEND
ARRAY
DATA
DELETE
DIM
EMPTY
ERASE
INSERT
ISARRAY
ISDIR
ISFILE
ISLINK
ISMAP
ISNUMBER
ISSTRING
LBOUND
LEN
READ
REDIM
RESTORE
SEARCH
SORT
SWAP
UBOUND
If there is insufficient information on this page and you wish learn more about READ,
please send an email to smallbasic@gmail.com. You can help to improve information about
READ by submitting a pull request,
click View Source for details. Note, an offline language reference text file is also available - see the Download section.