PUT# - DualBrain/bsharp Wiki

To write a record from a random buffer to a random disk file.


PUT[#]file number[,record number]


file number is the number under which the file was opened.

record number is the number of the record. If it is omitted, the record has the next available record number (after the last PUT#).

The largest possible record number is 232-1. This will allow you to have large files with short record lengths. The smallest possible record number is 1.

The PRINT#, PRINT# USING, LSET, RSET, or WRITE# statements may be used to put characters in the random file buffer before a PUT# statement.

In the case of WRITE#, BASIC pads the buffer with spaces up to an enter.

Any attempt to read or write past the end of the buffer causes a Field overflow error.