OPERATION
Flow of execution control
ro programming language contains statements to control the flow of
• ere in the
tered. The
first typing a colon
: “ :MyLabel”
• e macro
• ther true or false. Only
Example2: 2==3 yields false (two is not equal to 3)
• if then: Tests a Boolean expression and executes the then statement depending
est. Example: if d1>1 then goto MyLabel
Ca
Ho
• an internal
nything unless you store a
e types (like string and integer) the
variables type.
nd vice versa
3
Yields s1 to have the value “123”
• tors work on integers and floating point
increments d1 with 1)
• nate two strings using the + operator.
• ors:
• mainder of an integer division: Example: 17 % 3
= 2 (since 17-5*3=2)
• Formatting output: Use the format function to make the result look the way
you like it. The format function uses the standard c format function so any c
programmer should be familiar to this function
Example: s1 = format(”num:%.4d, float:%.3f”,12, 4.345234)
Yields s1 = “num:0012, float:4.345”
How to control the program flow:
The mac
execution:
Labels: A label is some kind of bookmark that you can insert anywh
macro definition. A label does not consume CPU time when encoun
label statement required for branching. A label is inserted by
followed by a name. Example
goto; Moves the point of execution to a label anywhere in th
definition. Example: goto MyLabel
Boolean test: compares two values and yields ei
numbers can be tested. Use the operators >, < and == (double equal sign) to
perform the test
Example1: 1<2 yields true (1 is less than 2)
on the t
lculations
w to perform calculus
Equal operator: Used to store a result in a variable (that can be
variable or an output variable). A macro does not do a
result somewhere. When mixing two variabl
macro tries to translate the source variables data to the destination
Thus allowing us to insert an integer value in a text variable a
Example d1 = “123 some text” Yields d1 to be the value 12
Example s1 = d1
+-*/: Standard mathematical opera
variables. Example d1 = d1 + 1 (
String concatenation: Concate
Example: s1=s1 + s2;
Boolean operat
Logical AND (&): Example 1 & 0 = false
Logical OR: (|): Example 1 | 0 = true
Logical XOR: (^): Example 1^0 = true
Modulo: (%): Returns the re
(
140) 27864 Issue 1 January 2008