Language Elements; Statements And Expressions; Assignments; Variables - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Language Elements

Statements and Expressions

A statement refers to a complete programming instructions such as:
Each of these statements compile, providing the referenced variables are defined.
Expressions are sub-components of statements. The following expressions are used in the above
example:
Expressions will not compile outside the context of a statement.

Assignments

Assignment statements include:

Variables

The simplest type of assignment statement is a variable, which assigns the value of an expression to a
variable. The expression may be a constant, a variable / mathematical / logical expression, or a return
from function. The data type associated with the expression should match the data type of the variable
receiving the assignment. If not, the value of the expression is typecast to match the destination variable.
An example is:
VariableName = <expression>

Output channels

This type of statement is typically used for feedback. It sends an output change to the specified channel
on the given device. An example is:
[Device, Channel] = <expression>
The expression is evaluated as follows:
NetLinx Programming Language Reference Guide
Y = X
X = X + 1
IF (Y < 10) Y = Y + 1
[TP, 5] = [VCR, 1]
X + 1
Y < 10
Y + 1
[TP, 5]
[VCR, 1]
It is strongly recommended that each statement appear on a separate line. The compiler cannot
enforce this since full backward compatibility with the previous Axcess language must be
maintained.
It is also strongly recommended that semicolons be used to terminate each statement (as in the
C language).
Variables
Output Channels
(* Variable Assignment Statement *)
(* Arithmetic Assignment Statement *)
(* IF Statement *)
(* Feedback Statement *)
(* Arithmetic Expression *)
(* Logical Expression *)
(* Arithmetic Expression *)
(* I/O Device Expression *)
(* I/O Device Expression *)
Language Elements
31

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents