8 File Storage

Creating a Data File

The CREATE statement is used to create a data file. Syntax for this statement is as follows:

[F]CREATE file spec ,number of defined records [,record lenght]

The record length is a numeric expression specifying the length of logical records in bytes and is rounded up to an even integer. If it is not specified, a record length of 256-bytes is assumed.

The number of defined records and the record length can be numeric expressions in the range 0 to 999999.

On the HP 9000 Series 800, a value greater than zero for number of defined records creates a special data file (one containing header information). A value of zero for number of defined records creates a regular data file, in other words an ASCII text file with no header information. Note, however, that in this case you cannot specify a record length.

On the HP 260, if the number of defined records is zero, no data file is generated and ERROR 67 is returned.

In contrast to HP BASIC/260, the Eloquence statements FCREATE and CREATE are identical. Neither of them generates an end-of-file (EOF) marker.

Two examples of the CREATE statement are listed here:

CREATE "DATA",0
Creates a regular data file


CREATE "DATA",10
Creates a special data file


Eloquence Language Manual - 19 DEC 2002