Programming
85
NetLinx Studio (v2.4 or higher)
Syntax Highlighting
When a source file is loaded in the editor, it is read line by line. Each line is broken up into its
constituent words. Technically the line is broken into tokens, but the concept of a word is more
familiar to most people. Different words and groups of words are handled differently. Here is a
breakdown of the mechanism used:
Default Syntax Highlighting Colors
The text in the Source Code Editor windows is syntax highlighted with color codes for increased
readability with a default set of colors that can be customized via the options in the Editor tab of the
Preferences dialog. Syntax Highlighting assigns different colors to different types of data in your
Source Code file.
Comments
Any portion of the line that initiates or falls within a comment is considered
to be one comment (essentially it's treated as one big word). The com-
ment is then syntax highlighted using the color specified in Preferences >
Editor > Comment.
Language Reserved
Words
When NetLinx Studio is started it loads two files: NetLinx.rw and
Axcess.rw. These are the "reserved word" files. These files contain all of
the words that NetLinx Studio will consider to be "Language Reserved
Words". Language Reserved Words are syntax highlighted using the color
specified in Preferences > Editor > Language Reserved Word.
If a partial word that is typed is recognized as a reserved word, the editor
will suggest its closest match.
Operator
All of the following operators
= < > + - * / % ! & | ^ ~ <= >= <> && || ^^
and the longer forms:
BOR AND XOR NOT BAND BNOT BXOR OR
are syntax highlighted using the color specified in Preferences > Editor >
Operator.
Floating Point
Numbers
A number is considered a floating point number if it contains a decimal
point. Floating point numbers are syntax highlighted using the color speci-
fied in Preferences > Editor > Floating Point Number.
Number
A number is any series of digits that does not include a decimal point. A
number may have the optional prefix "$" for hex or the optional postfix "b"
for binary. If the number is a hexadecimal number then it may contain the
letters A-F or a-f. Numbers are syntax highlighted using the color specified
in Preferences > Editor > Number.
String
Strings are any series of characters and digits that occur within two single
quotes. Strings are syntax highlighted using the color specified in Prefer-
ences > Editor > String.
Constants, Devices,
Type, Variable
Since NetLinx code may be divided into the following sections
DEFINE_CONSTANT, DEFINE_DEVICE, DEFINE_TYPE,
DEFINE_VARIABLE, anytime a word is encountered that falls within one
of these sections it is parsed, remembered and then syntax highlighted
according to the section in which it occurred. So if a DEFINE_DEVICE
section contains a line that reads "dvTP = 128" the word dvTP will be
remembered as a device and syntax highlighted using the color specified
in Preferences > Editor > Device.
Additionally, if the editor recognizes that you have partially typed the name
of the above section variable (say "dv"), it will autosuggest "dvTP". It does
this for all of the items it encountered in any of the above DEFINE_ sec-
tions.
Default Text
Any word that is not recognized as any of the above is syntax highlighted
using the color specified in Preferences > Editor > Default Text.
Содержание NETLINX STUDIO V2.4
Страница 1: ...instruction manual Software NetLinx Studio v2 4 or higher ...
Страница 16: ...NetLinx Studio v2 4 or higher 4 NetLinx Studio v2 4 or higher ...
Страница 32: ...The NetLinx Studio v2 4 Work Area 20 NetLinx Studio v2 4 or higher ...
Страница 44: ...Working With Workspace Files 32 NetLinx Studio v2 4 or higher ...
Страница 88: ...Working With Systems and System Files 76 NetLinx Studio v2 4 or higher ...
Страница 118: ...Programming 106 NetLinx Studio v2 4 or higher ...
Страница 152: ...Working With Online Devices 140 NetLinx Studio v2 4 or higher ...
Страница 199: ...Index 187 NetLinx Studio v2 4 or higher ...