.getdata Method

Function:

Reads a specified number of bytes from the file opened "on" a currently selected file number (selection is made through fd.filenum). The data is read starting at the fd.pointer position.

Syntax:

fd.getdata(maxinplen as byte) as string

Returns:

The string with the data read from the file. The method also affects the state of fd.laststatus. The following status codes are possible:

0 — PL_FD_STATUS_OK: Completed successfully.

1 — PL_FD_STATUS_FAIL : Physical flash memory failure (fatal).

2 — PL_FD_STATUS_CHECKSUM_ERR: Checksum error has been detected in one of the disk sectors (fatal).

3 — PL_FD_STATUS_FORMAT_ERR: Disk formatting error has been detected (fatal).

8 — PL_FD_STATUS_NOT_READY: The disk is not mounted.

10 — PL_FD_STATUS_NOT_OPENED: No file is currently opened "on" the current value of the fd.filenum property.

See Also:

Writing To and Reading From Files, fd.setdata, fd.pointer, fd.setpointer, fd.filesize


Part

Description

maxinplen

Maximum number of bytes to read from the file. The length of returned data will depend on one of three factors, whichever is smaller: maxinplen argument, amount of data still available in the file counting from the current pointer position, and the capacity of receiving string variable.


Details

As a result of this method invocation, the pointer will be advanced forward by the number of bytes actually read from the file.


.getdata Method

Details