Regular API function

simPackTable / sim.packTable

Description Packs a table into a buffer. The table may contain other nested tables, nil, bool, number or string values. All other types (e.g. functions) will be considered as string or nil values. You can also use sim.packTable to quickly compare two tables or to perform a deep copy of a table. See also sim.unpackTable, the other stack functions and the other packing/unpacking functions.
C/C++
synopsis
simChar* simPackTable(simInt stackHandle,simInt* bufferSize)
C/C++
parameters
stackHandle: a stack handle obtained with simCreateStack. There must be a table located at the top of the stack.
bufferSize: the size of the returned buffer.
C/C++
return value
nullptr in case of an error, otherwise a data buffer. The user is in charge of releasing the returned buffer with simReleaseBuffer.
Lua
synopsis
buffer buffer=sim.packTable(any[]/map aTable,int packingScheme=0)
Lua
parameters
aTable: a script table.
packingScheme: 0 for CoppeliaSim format, 1 for CBOR format, 2 for CBOR format where doubles are packed as floats.
Lua
return values
buffer: a string buffer.
Python
synopsis
bytes buffer=sim.packTable(list aTable,int packingScheme=0)

<