qb45advr.hlp (
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
DATA Statement Details
◄QuickSCREEN► ◄Details► ◄Example► ◄Contents► ◄Index►
──────────────────────────────────────────────────────────────────────────────
DATA Statement Details
Syntax
DATA constant[,constant]...
The constant1, constant2, and so on in a DATA statement can be any
valid numeric or string constant.
Names of symbolic constants (defined in a CONST statement) appearing
in DATA statements are interpreted as strings, rather than names of
constants. For example, in the following program fragment the second
data item is a string, "PI", and not the value 3.141593:
CONST PI=3.141593
.
.
.
DATA 2.20, PI,45,7
.
.
.
A DATA statement may contain as many constants as will fit on a line.
The constants are separated by commas.
Note: String constants in DATA statements require double quotes only
if they contain commas, colons, or significant leading or
trailing spaces.
Null data items (indicated by a missing value) can appear in a data
list:
DATA 1,2,,4,5
When a null item is read into a numeric variable, the variable has
the value 0. When a null item is read into a string variable, the
variable has the null string value ("").
You may use any number of DATA statements.
When working in the QuickBASIC environment, DATA statements can only
be entered in the module-level code. QuickBASIC moves all DATA
statements not in the module-level code to the module-level code when
it reads a source file. READ statements using the DATA statements can
appear anywhere in the program.
DATA statements are used in the order in which they appear in the
source file. You may think of the items in several DATA statements as
one continuous list of items, regardless of how many items are in a
statement or where the statement appears in the program.
You may reread DATA statements by using the RESTORE statement.