The CREATE BDAT statement creates a binary data file with the specified length and record size on the mass storage media, in the specified directory or in the current working directory. CREATE BDAT does not open files; use ASSIGN to open files. Since Windows supports extendable files, the file is created with a zero length, but a CAT listing shows the number of records specified in the CREATE.
The record-size is a numeric expression, rounded to an integer in the range 1 to 65534 and should be an even integer or one. This specifies the number of bytes per record. The default is 256 bytes.
A utility program is provided with most versions of HTBasic to transfer BDAT files between HP LIF diskettes and DOS disks. Data can also be transferred between HTBasic and Series 200/300 computers by attaching an interface between the computers and writing a short program on each computer to transfer the data.
BDAT files must be written with MSB FIRST in order for the data to be correctly readable by a Series 200/300 computer. CONFIGURE BDAT can be used to specify the default byte ordering of created files. If CONFIGURE BDAT is not used, HTBasic creates BDAT files using the native byte order of the computer.
File Headers
HTBasic supports typed files as well as regular files. HTBasic file types are LIF ASCII, BDAT, BIN and PROG. As opposed to regular files, typed files have a header containing necessary information about the file. The presence of the header is transparent to BASIC programs and no action should be taken to account for it. HTBasic can work with files that have either an HTB or an HP LIF file header. The HTB file header is 256 bytes. The HP LIF file header is 512 or 768 bytes. The CONFIGURE CREATE statement determines which kind of header is created by this statement. By default, HTB file headers are created.