TableToMem -- write table contents to memory block (V6.0)
TableToMem(t, id, type[, table])
This function writes the contents of the table passed as the first parameter to the memory block object specified by id. The third parameter specifies the data type of the elements that should be written to the memory block. This can be either #BYTE (1 byte), #SHORT (2 bytes), #INTEGER (4 bytes), #FLOAT (4 bytes), or #DOUBLE (8 bytes).

The optional table argument can be used to set additional parameters for the operation. The following table fields are currently recognized:

This tag can be used to specify an offset in bytes inside the memory block that defines where TableToMem() should start to write elements. Defaults to 0 which means start writing at the beginning of the memory block.

If this tag is set to True, TableToMem() will switch byte order for all multi-byte data types when writing them to the memory block. This can be useful if you need to convert between big and little endian values. Defaults to False.

If there are more elements in the table than the memory block can store, this function will issue an error.

To convert a memory block back into a table, use the MemToTable() function. See MemToTable for details.

table whose contents should be written to the memory block
memory block to use
data type of the elements to write (see above)
optional: table configuring further parameters (see above)

Show TOC