NAME

data - store constants for subsequent READ access

SYNOPSIS

data Constant[, Constant]... 

DESCRIPTION

The data statement stores numeric and string constants so that they can be later read in using the read statement.  Constants appearing in a data statement must be separated by commas, spaces, or tabs.  Constants may be either numeric (integer, fixed point, floating point, hex, or octal) or string (surrounded by quotation marks if the string contains commas, colons, or significant leading or trailing spaces or tabs).  No expressions are allowed in the list.  If an underscore, single-quote, or "rem" appears in a data statement, it will be interpreted as part of the data, not as a special BASIC symbol. 

Any number of constants may appear in a data statement, any number of data statements may be used in a module and data statements may be placed anywhere in a module.  The constants appearing in the data statements of a module form one continuous list of items.  Read statements access the constants appearing in data statements in order of their occurrence. 

Use the restore statement to reread information from any line in the list of data statements. 

EXAMPLE

The program
	restore
	for i = 1 to 10
		read a(i)
	next i
	read b$
	data 5.06, 2.36, 5.48, 7.42, 8.01
	data 3.25, 3.26, 1.58, 2.24, 6.39
	data "the end"
	for i = 1 to 10
		print a(i)
	next i
	print b$
simply reads ten single-precision constants and one string constant from the data statements and then prints out those values. 

SEE ALSO

read, restore

DIAGNOSTICS

If the variable type (numeric or string) given in a read statement does not agree with the corresponding Constant in the data statement, a "Syntax error" occurs. 

USAGE NOTES

Data statements are accessed in the order in which they appear in the module. 

The data statements of a module are private to that module.  A module can not read the data statements of other modules. 

from The Basmark QuickBASIC Programmerís Manual by Lawrence Leinweber