.setbuffer Method


Writes a specified number of bytes into the currently selected RAM buffer of the flash memory (selection is made through the fd.buffernum property).


fd.setbuffer(byref data as string, offset as word) as word


Actual number of bytes written.

See Also:

Direct Sector Access, File-Based and Direct Sector Access Coexistence, fd.buffernum, fd.getbuffer, fd.getsector, fd.setsector, fd.checksum, fd.copyfirmware, fd.copyfirmwarelzo




A string with the data to be written to the buffer.


Starting offset in the buffer. Possible value range is 0-263 (the buffer stores 264 bytes of data, offset is counted from 0).


The length of data actually written into the buffer may be limited if all supplied data can't fit between the offset position in the buffer and the end of the buffer.

All file-based operations of the flash disk also load data into the RAM buffers. Switch to the RAM buffer #0 each time before performing direct sector access with this or other related methods — this will guarantee that you won't corrupt the files and/or the file system and cause disk dismounting (fd.ready becoming 0 — NO).

.setbuffer Method