Lists, Raw bytes, Null – Teledyne LeCroy Merlins Wand - Users Manual User Manual

Page 273: D.3 variables, Lists raw bytes null, Variables

Advertising
background image

257

CATC M

ERLIN

S

W

AND

2.00

C

HAPTER

D

User’s Manual

CATC Scripting Language

Lists

A list can hold zero or more pieces of data. A list that contains zero pieces
of data is called an empty list. An empty list evaluates to false when used in
an expression, whereas a non-empty list evaluates to true. List literals are
expressed using the square bracket ([]) delimiters. List elements can be of
any type, including lists.

[1, 2, 3, 4]
[]
["one", 2, "three", [4, [5, [6]]]]

Raw Bytes

Raw binary values are used primarily for efficient access to packet
payloads. A literal notation is supported using single quotes:

'00112233445566778899AABBCCDDEEFF'

This represents an array of 16 bytes with values starting at 00 and ranging
up to 0xFF. The values can only be hexadecimal digits. Each digit
represents a nybble (four bits), and if there are not an even number of
nybbles specified, an implicit zero is added to the first byte. For example:

'FFF'

is interpreted as

'0FFF'

Null

Null

indicates an absence of valid data. The keyword null represents a

literal null value and evaluates to false when used in expressions.

result = null;

D.3 Variables

Variables are used to store information, or data, that can be modified. A
variable can be thought of as a container that holds a value.

All variables have names. Variable names must contain only alphanumeric
characters and the underscore ( _ ) character, and they cannot begin with a
number. Some possible variable names are

x
_NewValue
name_2

Advertising