DATA
DATA constant1 [, constant2] … [, constantN]
Stores one or more constants, of any type, for subsequent access via READ command.
DATA commands are non executable statements that supply a stream of data constants for use by READ commands. All the items supplied by all the DATA commands in a program make up one continuous “string” of information that is accessed in order by your program’s READ commands. Use RESTORE to specify which data block should be read next.
Example 1
FOR I = 1 TO 3
READ v
PRINT v
NEXT
END
DATA 1,2,3
Example 2: Using several data commands.
FOR I = 1 TO 6
READ v
PRINT v
NEXT
END
DATA 1,2
DATA 3,4,5
DATA 6
Example 3: Specify which data block should be read.
RESTORE MyDataBlock
FOR I = 1 TO 3
READ v
PRINT v
NEXT
END
DATA 1,2,3
LABEL MyDataBlock
DATA 4,5,6
' Output: 4 5 6
Code samples using DATA
006 arrays+.bas
3d block lettes.bas
3d wire cube v1.bas
3d wire cube.bas
3d_palmx.bas
3dtictac.bas
3dttt.bas
3dttt.bas
7gables.bas
agendus.bas
anomail.bas
ascii 3d.bas
bairstow.bas
BAS_1968.bas
base64.bas
betrayal: crows ii.bas
bolmo.bas
bowling7.bas
Calendar.bas
calendar.bas
checkers.bas
checkers.bas
chess.bas
chess.bas
conrec-sb-v01.bas
coordplot.bas
crow.bas
cube3d.bas
dataminmax.bas