assert

assert(expression, message): void

Check if given value is TRUE. If it is not, script execution stops with an assertion error; message, if given, is included in the error text.

Table 1. Parameters

expression

Boolean

Expression or value to evaluate

message

String

Optional. Message to report when the assertion fails.

node = FindObject("aaa");
assert(node != null); //Will go through, if object with name "aaa" found and will exit script if not
assert(node != null, "Object aaa not found"); //Same, with custom message in the error text