Call directive – Teledyne LeCroy UWBTrainer Exerciser Script Language User Manual
Page 102

LeCroy Corporation
UWBTrainer Exerciser - Generation Script Language Reference Manual
94
10.19 Using the Call Directive for Generation
Procedure Insertions
You can declare a generation procedure with parameters and then "call" the generation
procedure using the Call directive. The Call command inserts the other procedure instructions
and takes into account the passed parameters or global variables at every call. This is called
"dynamic" insertion, as opposed to the "static" insertion implemented by the insert directive.
Note: The Call directive copies instructions from the generation procedure. The Insert directive
does not copy instructions from the generation procedure. Rather, the generation parser inserts a
special Insert instruction with a reference to the "inserted" generation procedure.
10.19.1 Calling Another Generation Procedure with Parameters
Using the Call directive, the parser can insert instructions from another generation procedure
and, before insertion, provide some values for local parameters for use during parsing of that
procedure.
Example 1
# Declare a frame template.
Frame
SOME_PKT_TEMPLATE
{
Field0 :
32
=
0xFEFEFEFE
}
# Declare a generation procedure with two numeric parameters.
Block1( x, y )
{
# Send a frame based on the template 'SOME_PKT_TEMPLATE'.
Send
SOME_PKT_TEMPLATE
{
# Procedure parameters 'x' and 'y' are used to override
# the default template field values.
Field0 = x + y
}
}