Teledyne LeCroy Merlins Wand - CSL manual (CATC Scripting Language Manual) User Manual
Page 14
![background image](/manuals/353522/14/background.png)
8
CATC Scripting Language for Bluetooth Analyzers
CATC
Manual Ver. 1.21
The above expression will evaluate to “Greater than or equal to 5” because the first
true expression is
x >= 5
. Note that a semicolon is required at the end of a
select
expression because it is not a compound statement and can be used in an
expression context.
There is also a keyword
default
, which in effect always evaluates to true. An
example of its use is
Astring = select {
A == 1 : "one";
A == 2 : "two";
A == 3: "three";
A > 3 : "overflow";
default : null;
};
If none of the first four expressions evaluates to true, then
default
will be eval-
uated, returning a value of
null
for the entire expression.
select
expressions can also be used to conditionally execute statements, similar
to C
switch
statements:
select {
A == 1 : DoSomething();
A == 2 : DoSomethingElse();
default: DoNothing();
};
In this case the appropriate function is called depending on the value of A, but the
evaluated result of the
select
expression is ignored.