Regular API function

simPersistentDataWrite / sim.persistentDataWrite

Description Writes a persistent data block. Persistent data, valid across all opened simulator scenes, remains until the simulator ends, or until it is cleared by writing an empty data block. If the options flag is set appropriately, then persistent data can also be stored on file, and be automatically reloaded next time CoppeliaSim starts. See also sim.persistentDataRead, sim.setStringSignal, sim.setIntegerSignal, sim.setDoubleSignal and sim.writeCustomDataBlock.
C synopsis simInt simPersistentDataWrite(const simChar* dataTag,const simChar* dataValue,simInt dataLength,simInt options)
C parameters
dataTag: name of the data block
dataValue: content of the data block (which may contain any value, including embedded zeros). If dataValue is an empty string, then the data block is cleared (if present).
dataLength: the size of the data block.
options: bit-coded. If bit 0 is set (1), then the data is also stored on file ("system/persistentData.dat"), and automatically reloaded next time CoppeliaSim start.
C return value
-1 if operation was not successful. In a future release, a more differentiated return value might be available
Lua synopsis number result=sim.persistentDataWrite(string dataTag,string dataValue,number options=0)
Lua parameters
Same as C-function
Lua return values
Same as C-function

All regular API functions on one page