D.10 preprocessing, Preprocessing – Teledyne LeCroy Merlins Wand - Users Manual User Manual

Page 290

Advertising
background image

274

CATC M

ERLIN

S

W

AND

2.00

C

HAPTER

D

User’s Manual

CATC Scripting Language

y = 3;

}
x + 3;

}

Compound statements can be used anywhere that any other kind of
statement can be used.

if (3 && 3)
{

result = "True!";
Trace(result);

}

Compound statements are required for function declarations and are
commonly used in if, if-else, while, and for statements.

D.10 Preprocessing

The preprocessing command %include can be used to insert the contents
of a file into a script. It has the effect of copying and pasting the file into the
code. Using %include allows the user to create modular script files that
can then be incorporated into a script. This way, commands can easily be
located and reused.

The syntax for %include is this:

%include “includefile.inc”

The quotation marks around the filename are required, and by convention,
the included file has a .inc extension.

The filenames given in the include directive are always treated as being
relative to the current file being parsed. So, if a file is referenced via the
preprocessing command in a .script file, and no path information is provided
(%include “file.inc”), the application will try to load the file from
the current directory. Files that are in a directory one level up from the
current file can be referenced using “..\file.inc”, and likewise, files
one level down can be referenced using the relative pathname
(“directory\file.inc”). Last but not least, files can also be referred
to using a full pathname, such as
“C:\global_scripts\include\file.inc”

.

Advertising