Compile Operations
113
NetLinx Studio (v2.4 or higher)
Compiler Warnings
Sometimes the compiler generates a warning message instead of an error message; these warning
messages always start with w. A warning about a particular statement means that the statement is
not technically an error, but you should be careful doing it. Warnings, unlike errors, do not stop the
program from compiling. Some types of warnings can be disabled in the Compiler Options tab of
the Preference dialog. Common compiler warnings are described below:
(w) Cannot assign
unlike types
This warning occurs when a variable or value of one type is assigned to a
variable of a different type. Here are some examples:
• Assigning a string literal, string expression, or array to a non-array
variable
• Assigning a non-array variable to an entire array
• Assigning an integer array to a non-integer array
• Assigning a two-dimensional array to a one-dimensional array, or vice
versa
• Assigning the result of a function that returns an array type to a non-array
variable or to a two-dimensional array variable (for example,
X = ITOA(12), where X is a non-array variable or two-dimensional array
variable)
• Assigning the result of a function that returns a non-array type to a one- or
two-dimensional array variable (for example, X = ATOI('AMX'), where X is
a one- or two-dimensional array variable)
This message is a warning and not an error, because X = ITOA(12) works
correctly when X is a simple variable, since the result is a single value
between Ø and 65,535. The generation of this warning can be turned on or
off in the Compiler Options tab of the Preference dialog.
(w) Define_Call is
not used
This warning occurs at the end of program compilation for each
DEFINE_CALL subroutine that was declared but never used. The genera-
tion of this warning can be turned on or off in the Compiler Options tab of
the Preference dialog
(w) Integer applies
to arrays only
This warning appears when the keyword INTEGER is applied to a non-array
type of variable. Doing this is not an error, because non-array variables are
already integers, but it is redundant. The generation of this warning can be
turned on or off in the Compiler Options tab of the Preference dialog.
(w) Long_While
within While
This warning occurs if the compiler finds a LONG_WHILE or
MEDIUM_WHILE inside a block of code following a WHILE keyword. This
warning exists because the WHILE command has a 1/2 second timeout
period, and the LONG_WHILE and MEDIUM_WHILE keywords do not. This
could create a hard-to-find logic error. The solution is to change the WHILE
to a LONG_WHILE to fix this problem. The generation of this warning can
be turned on or off in the Compiler Options tab of the Preference dialog.
(w) Possibly too
many nested levels
This warning appears if there is a large amount of nesting in the program.
This can happen with a long chain of IF...ELSE IF statements. The solution
is to use the SELECT...ACTIVE set of statements. The generation of this
warning can be turned on or off in the Compiler Options tab of the Prefer-
ence dialog.
(w) Variable is not
used
This warning occurs at the end of compilation for each variable that was
declared but never used. The generation of this warning can be turned on
or off in the Compiler Options tab of the Preference dialog.
Содержание 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 ...