1mNAME0m
       array - Manipulate array variables

1mSYNOPSIS0m
       1marray 4m22moption24m 4marrayName24m ?4marg24m 4marg24m 4m...24m?


1mDESCRIPTION0m
       This  command  performs one of several operations on the variable given
       by 4marrayName24m.   Unless  otherwise  specified  for  individual  commands
       below,  4marrayName24m  must be the name of an existing array variable.  The
       4moption24m argument determines what action is carried out by  the  command.
       The legal 4moptions24m (which may be abbreviated) are:

       1marray anymore 4m22marrayName24m 4msearchId0m
              Returns 1 if there are any more elements left to be processed in
              an array search, 0 if all elements have already  been  returned.
              4mSearchId24m  indicates which search on 4marrayName24m to check, and must
              have been the return value from a previous invocation  of  1marray0m
              1mstartsearch22m.  This option is particularly useful if an array has
              an element with an empty name, since the return value from 1marray0m
              1mnextelement  22mwon't  indicate  whether  the  search has been com-
              pleted.

       1marray donesearch 4m22marrayName24m 4msearchId0m
              This command terminates an array search  and  destroys  all  the
              state  associated  with  that  search.  4mSearchId24m indicates which
              search on 4marrayName24m to destroy, and must have  been  the  return
              value  from a previous invocation of 1marray startsearch22m.  Returns
              an empty string.

       1marray exists 4m22marrayName0m
              Returns 1 if 4marrayName24m is an array variable, 0 if  there  is  no
              variable by that name or if it is a scalar variable.

       1marray get 4m22marrayName24m ?4mpattern24m?
              Returns  a list containing pairs of elements.  The first element
              in each pair is the name of an element in 4marrayName24m and the sec-
              ond element of each pair is the value of the array element.  The
              order of the pairs is undefined.  If 4mpattern24m is  not  specified,
              then  all  of  the  elements  of  the  array are included in the
              result.  If 4mpattern24m is specified, then only those elements whose
              names  match  4mpattern24m (using the matching rules of 1mstring match22m)
              are included.  If 4marrayName24m isn't the name of an array variable,
              or  if  the  array  contains  no elements, then an empty list is
              returned.

       1marray names 4m22marrayName24m ?4mpattern24m?
              Returns a list containing the names of all of  the  elements  in
              the array that match 4mpattern24m (using the matching rules of 1mstring0m
              1mmatch22m).  If 4mpattern24m is omitted then the command returns  all  of
              the element names in the array.  If there are no (matching) ele-
              ments in the array, or if 4marrayName24m isn't the name of  an  array
              variable, then an empty string is returned.

       1marray nextelement 4m22marrayName24m 4msearchId0m
              Returns  the  name of the next element in 4marrayName24m, or an empty
              string if all elements of 4marrayName24m have already  been  returned
              in  this  search.   The 4msearchId24m argument identifies the search,
              and must have been the return value of an 1marray startsearch 22mcom-
              mand.   Warning:   if  elements are added to or deleted from the
              array, then all searches are automatically terminated just as if
              1marray  donesearch  22mhad  been invoked; this will cause 1marray nex-0m
              1mtelement 22moperations to fail for those searches.

       1marray set 4m22marrayName24m 4mlist0m
              Sets the values of one or more elements in 4marrayName24m.  4mlist24m must
              have  a  form  like that returned by 1marray get22m, consisting of an
              even number of elements.  Each odd-numbered element in  4mlist24m  is
              treated  as  an element name within 4marrayName24m, and the following
              element in 4mlist24m is used as a new value for that  array  element.
              If  the  variable  4marrayName24m  does not already exist and 4mlist24m is
              empty, 4marrayName24m is created with an empty array value.

       1marray size 4m22marrayName0m
              Returns a decimal string giving the number of  elements  in  the
              array.   If  4marrayName24m  isn't  the  name  of  an array then 0 is
              returned.

       1marray startsearch 4m22marrayName0m
              This command initializes an  element-by-element  search  through
              the array given by 4marrayName24m, such that invocations of the 1marray0m
              1mnextelement 22mcommand will return the names of the individual ele-
              ments  in  the  array.   When the search has been completed, the
              1marray donesearch 22mcommand should be invoked.  The return value is
              a  search  identifier that must be used in 1marray nextelement 22mand
              1marray donesearch 22mcommands; it allows  multiple  searches  to  be
              underway simultaneously for the same array.

       1marray unset 4m22marrayName24m ?4mpattern24m?
              Unsets  all  of  the  elements  in  the array that match 4mpattern0m
              (using the matching rules of 1mstring match22m).  If 4marrayName24m  isn't
              the  name of an array variable or there are no matching elements
              in the array, then an empty string is returned.  If  4mpattern24m  is
              omitted and is it an array variable, then the command unsets the
              entire array.


1mKEYWORDS0m
