Teledyne LeCroy UWBTrainer Exerciser Script Language User Manual
Page 103

LeCroy Corporation
UWBTrainer Exerciser - Generation Script Language Reference Manual
95
# The generation procedure now has one structure variable parameter and
# two numeric parameters.
Block2( SOME_PKT_TEMPLATE $pkt_param, x, y )
{
# Send a frame based on the structure variable parameter
# to 'pkt_param'.
Send
pkt_param
{
Field0 = x + y
}
}
# Call another generation procedure.
Main
{
Send
TX_FRAME
# Send frame based on the template 'TX_FRAME'.
$X = SOME_PKT_TEMPLATE
# Declare a variable X as a frame of type
# SOME_PKT_TEMPLATE.
w =
1
u =
0xAABB
# "Call" the procedure 'Block2' with parameters.
# Note: The actual structure variable parameter
# must have '$' before the name of a variable.
Call
Block2 ( $X, w, u )
$X
# Change the local structure variable 'X'.
{
Field0 =
5096
}
w =
1024
# Change the local numeric variable 'w'.
u =
12
# Change the local numeric variable 'u'.
Call
Block2 ( $X, w, u )
# Call the procedure 'Block2' with new
# parameters.
# Note: The parser checks the variable structure parameters when
# processing the Call directive and allows only structure variables
# derived from the templates specified in the procedure declaration.
$X = DIFFERENT_TEMPLATE
# Redeclare a structure variable using a
# template not derived from 'SOME_PKT_TEMPLATE'.
Call
Block2 ( $X, w, w )
# !!! yields a parsing error.
}