Arrays


NetRexx also supports Java's fixed-size arrays. These are an ordered set of items, indexed by integers. To use an array, you first have to construct it; an individual item may then be selected by an index whose value must be in the range 0 through N-1, where N is the number of items in the array:

  array=String[3]            -- make an array of three Java Strings
  array[0]='String one'      -- set each array item
  array[1]='Another string'
  array[2]='foobar'
  loop i=0 to 2              -- display them
    say array[i]
    end

This 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.


[ previous section | contents | next section ]

From 'nrover.doc', version 1.113.
Copyright(c) IBM Corporation, 1996, 1997. All rights reserved. ©