Regular API function

simGetLastError / sim.getLastError

Description Retrieves the last generated error message for the calling thread and/or script. By calling this function, the last error message is reset and a subsequent call to this function returns NULL. Errors are memorized on a thread- and/or script basis (e.g. each script have each an individual error handler, so does the C API functions (when the simulation thread and the GUI thread are differentiated)). See also simSetLastError, sim.getStackTraceback, the sim.intparam_error_report_mode and the error report modes.
C synopsis simChar* simGetLastError()
C parameters
C return value
Error message buffer or NULL if no error message is present. The user has to delete the returned buffer with a call to simReleaseBuffer
Lua synopsis string lastError=sim.getLastError()
Lua parameters
Same as C-function
Lua return values
Same as C-function (but nil instead of NULL, and simReleaseBuffer does not need to be called)
Remote API equiv.
B0-based remote API: -
Legacy remote API: simxGetLastErrors

All regular API functions on one page