Regular API function

simSetScriptText / sim.setScriptText

Description Sets a new content for a script (i.e. attaches a new Lua code). During a simulation, the new script content might not be taken into consideration if a previous code was already executed at least once. See also simGetScriptText, sim.addScript and sim.associateScriptWithObject.
C synopsis simInt simSetScriptText(simInt scriptHandle,const simChar* scriptText)
C parameters
scriptHandle: handle of a script
scriptText: pointer to a script buffer (0-terminated buffer). This function will copy the buffer content, so that it can immediately be released after this call
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.setScriptText(number scriptHandle,string scriptText)
Lua parameters
Same as C-function
Lua return values
Same as C-function

All regular API functions on one page