HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4- 110
Table 4-12. Effect of File Type on PRINT Statement
---------------------------------------------------------------------------------------------
|| |||
||BASIC DATA | Binary | ASCII |
|| |||
---------------------------------------------------------------------------------------------
|| |||
| Sequential Write | Record indicated by | Record indicated by | Record indicated by |
| Starts at | record pointer. | record pointer. | record pointer. |
|| |||
---------------------------------------------------------------------------------------------
|| |||
| And Writes | As many records as needed | As many records as | As many records as |
| | for output list. | needed for output | needed for output |
| | | list. | list. |
|| |||
---------------------------------------------------------------------------------------------
|| |||
| Direct Write | Record
rnum
. | Record
rnum
. | Record
rnum
.|
| Starts at | |||
|| |||
---------------------------------------------------------------------------------------------
|| |||
| And Writes | One record. Error occurs | One record. Error | One record. Error |
| | if record cannot | occurs if record | occurs if record |
| | accommodate output list. | cannot accommodate | cannot accommodate |
| | | output list. | output list. |
|| |||
---------------------------------------------------------------------------------------------
|| |||
| Direct Word Write | Word
wnum
of record
rnum
.| Not allowed. | Not allowed. |
| Starts at | |||
|| |||
---------------------------------------------------------------------------------------------
|| |||
| And Writes. | As many records as needed | Not allowed. | Not allowed. |
| | for output list. | | |
|| |||
---------------------------------------------------------------------------------------------
NOTE Data that is written to an ASCII file by a PRINT statement cannot
be read accurately by a READ statement unless the PRINT statement
writes commas between data items on the file. For example, the
statement:
200 READ #1; A,B,C$,D$
can read the data written by the statement:
100 PRINT #1; 123, ",", 456, ",abc", ",def"
but not by the statement:
110 PRINT #1; 123,456,"abc","def"
FOR Clause in Display List
The display list of a PRINT statement can contain a FOR clause. The FOR
clause is similar to the FOR NEXT construct.
Syntax
(FOR
num_var
=
num_expr1
TO
num_expr2
[STEP
num_expr3
],
output_item_list
)