Chapter 8: preprocessing, Chapter 8, Preprocessing – Teledyne LeCroy Protocol Analyzers File-Based Decoding User Manual User Manual
Page 33

File-based Decoding User Manual
Chapter 8: Preprocessing
LeCroy Corporation
27
Chapter 8: 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
.dec file, and no path information is provided (%include
“
file.inc
”
), the
application tries to load the file from the current directory. If there is no such file in the
current directory, the application tries to load the file from the \Scripts\Shared
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
”
.