GLBasic User Manual

Main sections

DATA

DATA data1#$, data2#$, ...


The DATA command is used in conjunction with the RESTORE and READ commands to define data for your program without requiring it to be in an external file.

In contrast to DIMDATA, the data must be static, you cannot have variable values.
A DATA block can be placed outside of a FUNCTION.

Example:
RESTORE name
READ a // returns 1
READ b // returns 2
READ a$, b$, c, d // returns "x", "y", 3, 4
PRINT a+", "+b+", "+a$+", "+b$+", "+c+", "+d, 0,0

SHOWSCREEN
MOUSEWAIT
READ xxx // Error - out of data

STARTDATA name:
    DATA 1,2
    DATA "x", "y", 3,4
ENDDATA


Output:
1, 2, x, y, 3, 4

See also...