Instruction manual
USER GROUP NEWS
Issue 3 - Vol 2
MDP
PRODUCT
INFORMATION
BREAK
AND
NEXT
STATEMENT
RATIONAL provides a
statement
for leaving a loop early, and one for beginning the next iteration.
break
causes
an immediate exit from the loop; in effect
it
is a branch
to
the
statement
after loop.
next
is
a branch to the bot-
tom of the loop,
so
it causes
the
next iteration to be done.
For
example this code will exit
the
loop if "j"
is
equal
to
HI.
define
TRUE
1==
1
while (TRUE) {
if
(j==111)
break;
break
and
next
also work in
other
Rational
looping constructions.
break
and
next
can be followed by an integer to indicate breaking or iterating
that
level of enclosing loop;
thus
break 2
exits from two levels of enclosing loops, and
break
1
is
equivalent to break.
Next
2 iterates the second enclosing
loop. (Realistically, multi-level
break's
and
next's
are
not
likely
to
be much used because they lead to code
that
is
hard to understand and somewhat risky to change.)
TRANSLATION
SERVICES
Any line beginning
with"
%"
is
passed through
Rational
unaltered. Otherwise the following translation occurs
-
"
->
"
-"
"
&&"
->
"
and"
"
I
I"
->
" 0
r"
"
!="
->
"<>"
Anything preceded by a
"@"
is
a comment and
is
ignored by
Rational.
THOU SHALT NOTS
1.
Imbed a ";"
in
a
print
statement
and expect
it
to
act
like a
MDL/u
PRINT
statement
unless
it
is
pre-
ceded with a "%".
2.
Use
labels or any sort (especially line numbers).
3.
Pass a character or string
in
a switch expression.
John Owens, Systems Applications Manager
December
Hl83
TEKTRONIX
g