Instruction manual

USER
GROUP
NEWS
Issue 3 - Vol 2
This routine will function similarly
to
the
MDL/u
statements
FORI
= 1
TO
100
NEXT I
The
syntax of the
while
statement
is
while (legal
MDL/u
conditional)
Rational
statement
THE
FOR
STATEMENT
MPP
PRODUCT
INFORMATION
The
for
statement
is
another
Rational
loop, which
attempts
to carry the separation of loop - body from reason
for looping
a step further the the
while.
A
for
statement
allows explicit initialization,
extent,
and
increment
steps as
part
of the
statement.
For
example:
for (1=1;
1<=100;
1=1+2)
...
Is
equivalent to
i=O
while
(i<=100)
{
...
i=i+2
}
or the
MDL/u
source
FOR
1=
0
to
100
STEP
2
NEXT
I
However the
Rational
for
statement
is
not
a
MDL/u
FOR
statement.
The
MDL/u
FOR
is
not
supported
in
Rational.
The
syntax of the
for
statement
is
for (init;
condition;
increment)
Rational
statement
The
init, condition, and increment parameter may be
omitted
but
the
semicolons";"
must
be present. A non-
existent conditional
is
always true,
so
for (;;)
is
a loop forever.
THE
REPEAT
-
UNTIL
STATE:MENT
There are times when it
is
necessary to have a loop
that
tests at the
bottom
after one pass through.
This
is
done
by
the
repeat
-
until
statement.
repeat {
RATIONAL
statement
} until (conditional)
December 1983
TEKTRONIX
7