READB Statement

The READB statement reads the specified number of characters from a binary item.

Format

READB str FROM file.var,item.id,start.pos, no.of.bytes THEN/ELSE

Description

mvBASIC allows the user to read a specified number of characters from a binary item stored in a disk file. The format is very similar to READV, but rather than specifying the attribute to be read, the user specifies the starting position, and number of bytes to read. READBU behaves like READVU, and sets and obeys item locks.

If a start position of 0 is specified, the number of bytes (no.of.bytes) in the item is returned. If a start position beyond the end of the item is specified, null is returned. If too many bytes are specified, as many as are available are returned.

Binary items are stored in 2000 byte increments, so there may be extra data following the last meaningful data byte.

See Also

Statement and Function Reference