PickBASIC / FlashBASIC

readf statement

.md

The readf statement reads the specified number of characters from a normal item.

Syntax

readf str from file.var item.ID, start.pos, no.of.bytes then/else statement.block

Description

D3 allows the user to read a specified number of characters from any normal 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.

If a starting position of 0 is specified, the number of bytes in the item is returned. If a starting 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.

Examples

Read 10 bytes starting at position 10 from the item "10" in the orders file from the mvdemo account.

open 'mvdemo,orders,' to fv.o
readf str from fv.o,10,10,10
crt str