|
NetRexx Overview, version 1.160
Copyright (c) IBM Corporation, 2000. All rights reserved. © | 10 Feb 2000 |
| [previous | contents | next] |
if ask='Yes' then say "You answered Yes"
else say "You didn't answer Yes"
select... when... otherwise... end
for selecting from a number of alternatives:
select
when a>0 then say 'greater than zero'
when a<0 then say 'less than zero'
otherwise say 'zero'
end
do... end for grouping:
if a>3 then do
say 'A is greater than 3; it will be set to zero'
a=0
end
and loop... end for repetition:
/* repeat 10 times; I changes from 1 to 10 */
loop i=1 to 10
say i
end
The loop instruction can be used to step a variable to
some limit, by some increment, for a specified number of
iterations, and while or until some condition is
satisfied. loop forever is also provided, and
loop over can be used to work through a collection of
variables.
Loop execution may be modified by leave and iterate instructions that significantly reduce the complexity of many programs.
From
The NetRexx Language by
Mike Cowlishaw,