NetRexx Overview, version 2.02
Copyright (c) IBM Corporation, 2001. All rights reserved. ©
|22 May 2001|
|[previous | contents | next]|
array=String -- make an array of three Strings array='String one' -- set each array item array='Another string' array='foobar' loop i=0 to 2 -- display the items say array[i] endThis example also shows NetRexx line comments; the sequence -- (outside of literal strings or /* comments) indicates that the remainder of the line is not part of the program and is commentary.
NetRexx makes it easy to initialize arrays: a term which is a list of one or more expressions, enclosed in brackets, defines an array. Each expression initializes an element of the array. For example:
words=['Ogof', 'Ffynnon', 'Ddu']would set words to refer to an array of three elements, each referring to a string. So, for example, the instruction:
say wordswould then display Ffynnon.
The NetRexx Language by