.setdata Method


Writes data to a file opened "on" a currently selected file number (selection is made through fd.filenum). The data is written starting at the fd.pointer position.


fd.setdata(byref data as string) as pl_fd_status_codes


One of the following pl_fd_status_codes, also affects fd.laststatus:

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).

7 — PL_FD_STATUS_DATA_FULL: The disk is full, new data cannot be added.

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.

14 — PL_FD_STATUS_TRANSACTION_CAPACITY_EXCEEDED: Too many disk sectors have been modified in the cause of the current transaction (fatal).

See Also:

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




A string containing data to be written to the file. If the disk becomes full, then no data will be written (and not just the portion that could not fit).


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

This method makes changes to the sectors of the flash disk. For the highest possible reliability, use disk transactions when invoking this method.

.setdata Method