backIndex

Xelagot action script

Events: Error and LabelNotFound

Refer to Events for general information on Events, to Errors and debugging and to Labels and Subs.

These events are triggered (as from x1 2.999976) when some errors occur in the script.
x1 2.9999950 and av99 1.66 introduce the GetErrorXXX statemets.

Installer: OnErrorEvent <eventlabel>
Event type: 1

Installer: OnLabelNotFoundEvent <eventlabel>
Event type: 2

Specific statements (must be inside the event handler):

GetEventType %a stores the event type code in variable %a
GetEventResult %a is always -1
GetMessage $a retrieves the error message (in English).
GetErrorLine %i retrieves the line number where the error occurred.
GetErrorCommand $c retrieves the command that generated the error.
GetErrorLabelName $n retrieves the Label, Sub, Event that is not found or is out of scope. If the Label, Sub, Event names are packed in a string variable, retrieves the name of the variable (see GetErrorLabelValue). Not used in OnErrorEvent.
GetErrorLabelValue $v retrieves the Label, Sub, Event that is not found or is out of scope. If the Label, Sub, Event names are packed in a string variable, retrieves the contents of the variable. $v alway contains what the command actually points to.
Example: if $a = "Donkey", Goto $a is equivalent to Goto Donkey; GetErrorLabelName $n retrieves "$a", GetErrorLabelValue $v retrieves "Donkey".
Not used in OnErrorEvent.

Example:

OnErrorEvent ErrorE
OnLabelNotFoundEvent ErrorL
#...

Event ErrorE
  GetMessage $a
  Secret $a
  GetErrorLine %e
  GetErrorCommand $c
  SecretConcat "Error in line " %e " caused by command " $c
EndEvent

Event ErrorL
  GetMessage $a
  Secret $a
  GetErrorLine %e
  GetErrorCommand $c
  GetErrorLabelName $n
  GetErrorLabelValue $v
  SecretConcat "Error in line " %e " caused by command " $c " " $v
  IfString $n <> $v SecretConcat "The variable containing " $v " is " $n
EndEvent




backIndex