DREAD Verb
Syntax
DREAD inputlist{,ERR=lineref}
Description
For BBj-specific information, see the DREAD
Verb - BBj.
The DREAD verb assigns numeric or string values found in DATA statements
to the variables in inputlist.
Parameter |
Description |
---|---|
inputlist |
Variables that will be assigned values from the data read. The syntax and the manner in which it is interpreted are the same as in the READ verb. For example, IOL= is supported. There are two differences in the way DREAD and READ operate:
|
ERR=lineref |
Branch to be taken if an error occurs during execution. |
Attempting to DREAD past the last data item in the program results in an
!ERROR=2 (end-of-file). The data pointer
may be set and moved by the RESTORE statement. PRO/5 automatically resets
the data pointer to the beginning of the program during BEGIN, END, and
when the program is loaded.
An !ERROR=26 may result from trying to DREAD string data into a numeric
variable and vice versa. When this or any other error occurs while evaluating
a DATA item, the data pointer is not advanced.
DREAD can pick up mnemonics and any expressions that can be printed with
a "PRINT" statement. In data statements, you can put arithmetic
expressions, such as 2+2, use variables in the program, such as sin(x)),
put function calls, such as fnCalc_Total_Sales(tdy_sales,ytd_sales), and
string concatenations. The variable that the expression is being read
into must be of a type compatible with what the expression returns.
See the DATA and RESTORE
verbs for additional information.
Examples
1000 RESTORE 6000
1010 DREAD COUNT
1020 DIM COLOR$[1:COUNT]
1030 DREAD COLOR$[ALL]
…
6000 DATA 3,'RED','WHITE','BLUE'