try

From Bohemia Interactive Community
Revision as of 05:04, 23 July 2006 by Zyklone (talk | contribs) (added better short example, link to long description)
Jump to navigation Jump to search


try code


Operand types:

code: Code

Type of returned value:

Nothing

Compatibility:

Version 2.60 required.

Description:

Defines a try-catch structure.

This sets up an exception handling block.

Any thrown exception in a try block is caught in a catch block.

Example:

try {
  if (_name == "") then { 
    throw "No Name"
  }
}
 
catch {
  if (_exception == "No Name") then {
    ....
  }
}