NetRexx Overview, version 1.148
Copyright (c) IBM Corporation, 1998. All rights reserved. © | 23 Dec 1998 |
[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' enddo... end for grouping:
if a>3 then do say 'A is greater than 3; it will be set to zero' a=0 endand loop... end for repetition:
/* repeat 10 times; I changes from 1 to 10 */ loop i=1 to 10 say i endThe 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,