Hapter, Reprocessing – Teledyne LeCroy CATC Scripting Language Reference Manual User Manual

Page 30

Advertising
background image

C

HAPTER

8

Preprocessing

CATC Scripting Language

26

C

HAPTER

8: P

REPROCESSING

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 incorpo-

rated 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 .dec 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”

.

Additionally, the directory “shared” under “Scripts” is checked too. So if you want
to reference a file in the “shared” directory, you can reference it by its name without
any explicit pathname.

Advertising