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.
READ Statement Details
  QuickSCREEN      Details      Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
READ Statement Details
 
Syntax
  READ variablelist
 
A variablelist is a series of valid BASIC variables separated by commas.
 
READ statements are always used with DATA statements. READ assigns DATA
values to variables on a one-to-one basis. These variables may be numeric
or string. Attempting to read a string value into a numeric variable
produces a run-time syntax error. Reading a numeric value into a string
variable does not produce an error, but stores the value as a string of
numerals.
 
Values read into integer variables are rounded before the value is assigned
to the variable. Reading a numeric value too large for a variable produces
a run-time error.
 
String values read into fixed-length string variables are truncated if the
string is too long. String values shorter than the string-variable length
are left-justified and padded with blanks.
 
Only individual elements of a record variable may appear in a READ statement.
 
A single READ statement may use one or more DATA statements (they will be
used in order), or several READ statements may use the same DATA statement.
If there are more variables in variablelist than there are values in the
DATA statement or statements, an error message is printed that reads
"Out of DATA." If there are fewer variables than the number of elements
in the DATA statement or statements, subsequent READ statements begin
reading data at the first unread element. If there are no subsequent
READ statements, the extra items are ignored.
 
Use the RESTORE statement to reread DATA statements.