Skip to main content

Syntax

An expression is some sequence of operations that yields a result. A literal value, a variable, or a function by themselves can be an expression. The following are valid expressions:

5
"3"
myfunction( 1 )
5+3
5 + "3"
"5" + "3"
"5" + myfunction( innerfunction() - 6 )
$x + $y + $z

A PSLang expression can include a sequence of variable declarations (including initializers) and function calls. The final statement must be an expression; its value is taken as the overall result.

Here is a sequence of statements:

var $a = "hello";
var $b = ", world";
var $c = strlen( $a );
$a + $b + " - length: " + $c

This is acceptable as a PSLang expression because the last statement is itself a normal expression. The result here would be: hello, world - length: 5.

In the Bravura Security Fabric GUI, the same sequence of statements would be written on one line:

var $a = "hello"; var $b = ", world"; var $c = strlen( $a); $a + $b + " - length:" + $c