HTBasic supports several file types. Typed files for data are LIF ASCII and BDAT. HTBasic also supports files without a file type, which is the default.
BDAT files are FORMAT OFF by default and are used to hold binary data. But they may also be set to FORMAT ON with ASSIGN to hold ASCII data. BDAT files may be accessed sequentially or randomly. The record size for random access is established when the file is created with CREATE. If not specified, it defaults to 256 bytes.
By default, files are written as binary with FORMAT OFF, but you can specify FORMAT ON for ASCII printable files with lines that are terminated with a carriage return, line feed (CR/LF) sequence.
CREATE "TEMP.TXT",512 ! CREATE a file
ASSIGN @X TO "TEMP.TXT";FORMAT ON
INTEGER I
FOR I=1 TO 10
OUTPUT @X;"Line #";I
NEXT I
ASSIGN @X TO * ! Close file (by setting I/O path X to nothing)