For Loops - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

NetLinx Programming Overview
The following is the structure for the
SWITCH (<expression>)
{
}

FOR loops

loops are an alternative to traditional loops. Functionally they do the same thing, but
FOR
more readable.
structure for a
FOR (<INITIAL>;<condition>;<after pass>)
{
(* loop statements *)
}
18
Only the statements associated with the first case that matches the value of the expression are
executed. Multiple
statements can be stacked within the
CASE
the value matches one of the
CASE
executed.
If no
matches the
CASE
SWITCH
available) are executed. The default statement must be the last case within the
, otherwise the remaining case statements will not execute.
SWITCH...CASE
All cases must be unique.
Braces should be used to bracket the statements in a case. They are required only if variables
are declared within the case.
The
statement applies to the
BREAK
Unlike C and C++, cases do not fall through to the next case if a break is not used. Because of
this,
statements are not required between cases.
BREAK
SWITCH...CASE
CASE <numeric constant or string literal>:
{
(* statements for CASE 1 *)
}
CASE <numeric constant or string literal>:
{
(* statements for CASE 2 *)
}
CASE <numeric constant or string literal>:
{
(* statements for CASE n; there can be as many cases as necessary *)
}
DEFAULT <numeric constant or string literal>:
{
(* statements for DEFAULT case *)
}
loops, like
loops, do not process input changes from the message buffer. The
FOR
WHILE
loop is shown below:
FOR
SWITCH...CASE
statements, the statements associated with the stack will be
expression, then the statements under the default case (if
and takes execution to the end of the
SWITCH
statement:
NetLinx Programming Language Reference Guide
statement. If
.
SWITCH
loops are
FOR

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents