Futurebasic/Language/Reference/data
Function
edit✔ Appearance ✔ Standard ✔ Console
Syntax
editDATA item1 [,item2 ...]
Description
editThis statement is used to list data constants (numbers or strings, quoted or unquoted) to be accessed by the READ
statement. Each item must be a numeric or string constant; string constants may be quoted or unquoted. The items are separated by commas. Leading spaces (between a comma and the item that follows it, or between the DATA
keyword and the first item) are ignored; therefore, if you wish to represent a string item which contains commas and/or leading spaces, you must enclose it in quotes. Trailing spaces in an unquoted string item are not ignored; they're considered part of the string.
To represent a numeric item in a DATA
statement, you can use a decimal, hex, octal or binary constant.
You can have as many DATA
statements in your program as you like, and as many or as few items in each DATA
statement as you like. The only restriction is that the total number of data items (in all DATA
statements) must be at least enough to satisfy all READ
requests. You can use the RESTORE
statement to allow DATA
items to be read more than once.
DATA
statements are global in scope: this means that any READ
statement (whether it's in a local function, or in "main") can access any DATA
statement (whether it's in a (possibly different) local function, or in "main"). DATA
statements are "non-executable," which means you can't change their effect by putting them inside a conditional execution structure such as LONG IF
...END IF
. However, you can conditionally include or exclude them from the program by putting them inside a COMPILE LONG IF
block.
Note that everything between the DATA
keyword and the end of the line is considered part of the DATA
statement. In particular, this means that you cannot use the ":
" separator to put another statement after the DATA
statement on the same line, and you cannot put a comment after the DATA
statement on the same line.
See Also
editREAD; RESTORE; COMPILE LONG IF