HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

6- 23
| | on the command. | on the command. | on the command. |
|||||
---------------------------------------------------------------------------------------------
|||||
| Formatted |No |Yes |No |
|||||
---------------------------------------------------------------------------------------------
|||||
| Input | READ statement, | READ statement. | READ statement. |
| | LINPUT statement. | | |
|||||
---------------------------------------------------------------------------------------------
|||||
| Output | PRINT statement. | PRINT statement. | PRINT statement. |
|||||
---------------------------------------------------------------------------------------------
|||||
| Misc. | Data items are | READ statement | No wasted space; no |
| | separated by commas | type-checks BASIC | item separators as |
| | or record boundaries | DATA file data before | there are in ASCII |
| | in an ASCII input | assigning it to | files. No item |
| | file. | variables. | descriptors as there |
| | | | are in a BASIC DATA |
| | PRINT statement must | Direct word reads and | file. |
| | print commas between | writes are possible | |
| | data items if READ | (see "File Input and | |
| | statement is to read | Output"). | |
| | ASCII file after it | | |
| | is printed. | Conceptually, a | |
| | | series of data items | |
| | | actually, a series of | |
| | | records. | |
|||||
---------------------------------------------------------------------------------------------
----
The BASIC DATA file is the only formatted file. It contains format words
that describe each datum. When a program writes a datum to a BASIC DATA
file, HP Business BASIC/XL writes the appropriate format words to the
BASIC DATA file (the statement that writes to the file need not specify
them). When a program reads a string datum from a BASIC DATA file, HP
Business BASIC/XL checks the format words for its type and for its size.
Conceptually, a BASIC DATA file is a series of data items, rather than a
series of records. Actually, it is composed of records; each record
contains as many whole data items as it can, with one immediately
following another. A datum never crosses a record boundary.
ASCII and binary files are unformatted; they do not contain format words
that describe their data.
File Identification
The CREATE statement or operating system command that creates a file
names the file; the ASSIGN statement assigns a file number to it. The
CATALOG and file management statements reference files by their names;
the file functions and other statements reference them by their numbers.
fname
is a file name used in the Syntax Specification in chapter 4.
fname
is represented by one of the following:
* A quoted string literal (for example, "Myfile").
* An unquoted string literal (for example, Myfile).
* A string expression (for example, "File"+ A$).
The following restrictions apply to an unquoted string literal file
representation:
* It must begin with a letter (uppercase or lowercase).