beautypg.com

Expression on variables, If/while in logical expressions – Teledyne LeCroy STX M6-1 SAS_SATA Protocol Analyzer User Manual User Manual

Page 403

background image

    

Sierra M6‐4 SAS/SATA Protocol Analyzer User Manual

401

Sierra Trainer Generation Language

LeCroy Corporation

Expression on Variables

Mathematical expressions, such as sum, subtract, and shift:

@varName1 + @varName2

@varName1 - @ varName2

@varName1 & @varName2

@varName1 | @varName2

@varName1 << 2

Logical expressions, such as compare, equal, not, and, and or:

@varName1 > @varName2

@varName1 < @ varName2

@varName1 == @varName2

@varName1 != @ varName2

(logical expression1) && (logical expression2)

(logical expression1) || (logical expression2)

Complex expressions (combination of different operators) with prioritizing supported:

(@varName1 + @varName2) > @varName3

If/While in Logical Expressions

Like programming languages, scripts allow conditional statements. 
The if/while syntaxes are:

If (expression)

{

….

}

else

{

….

}

While(@VarName)

{

…….

}

Note:

In this release, while condition is limited to simple variable values only. Combining operators is

not allowed in while expressions. You should move such expressions inside while block.

Note:

Nested while and if are supported.