This information is for Vicon Shogun 1.7. For up-to-date help, see the latest Shogun documentation.

Vicon Shogun banner

Description

Provides a runtime test for error conditions. If the test returns true, the assert passes and does nothing. If the test returns false, the script terminates and an assertion failure is reported along with any number of additional arguments supplied to the assert statement after the test.

The additional arguments can be any string or value that can be printed, similar to the print command.

Functional area

System

Command syntax

Syntax

assert booleanExpression [optionalMessage1] [optionalMessage2] ...

Arguments

NameTypeRequiredComments
booleanExpressionbooleanyesThe condition to check for. If this condition evaluates to false, then the assert will fire and your script will fail.

Flags

None

Return value

void

Examples

int $i; 
// Do something intelligent to set the value of i
$i = 400;
// Check to make sure $i was set properly
assert( $i == 400, "i was improperly set to ", $i );

Additional information

Related commands