Eventscripts lasterror

From EventScripts Community Encyclopedia

Description

eventscripts_lasterror stores a message from the last error EventScripts encountered while processing code.


It is mostly useful for script writers, but can be used for debugging by an end-user as well.


eventscripts_lasterror can be used as a quasi-command from the console (will display last error message to console), or accessed via EventScripts like any other variable by using:

server_var(eventscripts_lasterror)


An example of an error would be: "eventscripts_lasterror" = "Key not found" ( def. "" )


Many of the error messages (most commonly the one above) are harmless.


Syntax: eventscripts_lasterror
Note: Command parameters are described inside the < and > characters. Optional parameters are contained within [ and ] characters.

Examples

eventscripts_lasterror is mostly useful as a quasi-command from the console, however an example is provided below for reference.

player_say.cfg

if (event_var(text) equalto "showlasterror") then es_xmsg Last Error - server_var(eventscripts_lasterror)


--Faaip 16:55, 16 July 2006 (EDT)

blog comments powered by Disqus