D.7 comments, D.8 keywords, Comments keywords – Teledyne LeCroy Merlins Wand - Users Manual User Manual

Page 284

Advertising
background image

268

CATC M

ERLIN

S

W

AND

2.00

C

HAPTER

D

User’s Manual

CATC Scripting Language

D.7 Comments

Comments may be inserted into scripts as a way of documenting what the
script does and how it does it. Comments are useful as a way to help others
understand how a particular script works. Additionally, comments can be
used as an aid in structuring the program.

Comments in CSL begin with a hash mark (#) and finish at the end of the
line. The end of the line is indicated by pressing the Return or Enter key.
Anything contained inside the comment delimiters is ignored by the
compiler. Thus,

# x = 2;

is not considered part of the program. CSL supports only end-of-line
comments, which means that comments can be used only at the end of a line
or on their own line. It's not possible to place a comment in the middle of a
line.

Writing a multi-line comment requires surrounding each line with the
comment delimiters

# otherwise the compiler would try to interpret
# anything outside of the delimiters
# as part of the code.

The most common use of comments is to explain the purpose of the code
immediately following the comment. For example:

# Add a profile if we got a server channel
if(rfChannel != "Failure")
{

result =

SDPAddProfileServiceRecord(rfChannel,
"ObjectPush");

Trace("SDPAddProfileServiceRecord returned ",

result, "\n");
}

D.8 Keywords

Keywords are reserved words that have special meanings within the
language. They cannot be used as names for variables, constants or
functions.

Advertising