beautypg.com

13 preprocessor if operator, Preprocessor if operator, Directive – Teledyne LeCroy UWBTrainer Exerciser Script Language User Manual

Page 97

background image

LeCroy Corporation

UWBTrainer Exerciser - Generation Script Language Reference Manual

89

10.13 Preprocessor If Operator

A special preprocessor directive includes/excludes different parts of generation code depending
on some condition.

Examples

Main

{

x = 180

y = 30

# Short if operator with only a 'then' clause

if

( x > y )

{

# This block is parsed the usual way and all instructions

# are added to the current instruction block.

Send TX_FRAME

Send MMC_FRAME( Delay = 2000 )

}

if

( x < y )

{

# This block is parsed in a special way:

# Only the "{" "}" are taken into account.

# All other stuff is ignored.

Send WINET_FRAME

{

DestAddr = 0xAABB

SrcAddr = 0xEFBE

Data = { AA BB CC DD 12 34 56 78 [PATTERN_2] }

}

( Delay = 100000 )

}

# Full if operator with both 'then' and 'else' clauses.

if

( x > y )

{

# This block is parsed the usual way and all instructions

# are added to the current instruction block.

Send MY_WUSB_FRAME

Send MMC_FRAME( Delay = 2000 )

}

else

{

# This block is parsed in a special way.

# Only "{" "}" are taken into account.

# All other stuff is ignored.

Send MY_WUSB_FRAME

}

}