Chapter 13 Device Logic (Pawn)
13.4.6.8 Do statement while (expression)
Executes a statement before the conditional part (the "while" condition) is evaluated. The statement is
repeated as long as the condition is logical "true". The statement is executed at least once.
Example:
example(n)
{
new a = 0
do
{
a++
}
while(n >= 0)
return a
}
13.4.6.9 Exit expression
Cancels the program. The expression is optional, however, if present it must start and end on the same line
as the "exit" statement. The exit statement returns the expression value or zero to the main application, if no
expression is specified.
13.4.6.10 For (expression 1; expression 2; expression 3) statement
All three of the expressions are optional.
Expression 1:
Is only evaluated once before entering the loop. This expression can be used to initiate a variable. This
expression also includes the variable declaration by means of the "new" syntax. A variable that is
declared at this stage is only valid in the loop. It is not possible to combine an expression (with existing
variables) and a declaration of new variables in this field. All of the variables must either already exist in
this field, or they must all be declared in this area.
Expression 2:
This expression is executed before every run of the loop and terminates the loop if the expression
logical "false" is returned. If this expression is omitted, it is assumed that the result of expression 2 is
logical "true".
Expression 3:
This expression is executed each time the statement is completed. The program control moves from
expression 3 to expression 2 for the next (conditional) iteration of the loop.
Rev. 05
225
Summary of Contents for myDatalogEASY V3
Page 2: ......
Page 13: ...Chapter 2 Declaration of conformity Chapter 2 Declaration of conformity Rev 05 13 ...
Page 14: ......
Page 42: ......
Page 76: ......
Page 88: ......
Page 102: ......
Page 110: ......
Page 116: ......
Page 234: ......
Page 244: ......
Page 252: ......
Page 254: ......
Page 266: ......
Page 276: ......