.Setbuffer Method

Top  Previous  Next

Function:

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

Syntax:

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

Returns:

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

 


Part

Description

data

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

offset

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

Details

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