HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4- 116
wnum
Word number, a numeric expression. If a file I/O
statement specifies
wnum
, it is a direct word. Direct
word reads are allowed only with BASIC DATA files.
[{,} ]
input_list item
[{;}
item
]...
Each item is a numeric or string variable, an array
reference, or a FOR clause. An array reference has the
syntax
array_name
([*[,*]...])
with one asterisk per dimension or it does not have
asterisks. Not using asterisks specifies any number of
dimensions. Either format is legal, but the format
without asterisks is noncompilable.
A FOR clause has the syntax
(FOR
num_var
=
num_expr3
TO
num_expr4
[STEP
num_expr5
],
input_list
)
A sequential read must have an
input_list
.
If a direct read does not have an
input_list
, it is the same as the POSITION
#fnum;rnum
statement. That is, it positions the file at the beginning of record
rnum
.
When used with data files, the READ statement assigns one file datum to
one input item. It accesses its input items from left to right. It
reads BASIC DATA, binary, and ASCII files differently; see Table 4-14.
Table 4-14. Effect of File Type on READ Statement
---------------------------------------------------------------------------------------------
|||||
||BASIC DATA | Binary | ASCII |
|||||
---------------------------------------------------------------------------------------------
|||||
| Sequential Read | Datum indicated by | Record indicated by | Record indicated by |
| Starts at | datum pointer. | record pointer | record pointer. |
| | | (possibly within | |
| | | unexhausted record). | |
|||||
---------------------------------------------------------------------------------------------
|||||
| And Reads | As many records as | As many records as | As many records as |
| | needed to satisfy | needed to satisfy | needed to satisfy |
| | input list. | input list. | input list. |
|||||
---------------------------------------------------------------------------------------------
|||||
| Direct Read Starts at | Record
rnum
. | Record
rnum
. | Record
rnum
.|
|||||
---------------------------------------------------------------------------------------------
|||||
| And Reads | As many records as | As many records as | As many records as |
| | needed to satisfy | needed to satisfy | needed to satisfy |
| | input list. | input list. | input list. |
|||||
---------------------------------------------------------------------------------------------
|||||
| Direct Word Read | Word
wnum
of record | Not allowed. | Not allowed. |
| Starts at |
rnum
.| | |
|||||
---------------------------------------------------------------------------------------------
|||||
| And Reads | As many records as | Not allowed. | Not allowed. |
| | needed to satisfy | | |
| | input list. | | |
|||||