home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tclX-6.4 / help / variables / array < prev    next >
Encoding:
Text File  |  1992-12-17  |  3.4 KB  |  61 lines

  1.           array option arrayName ?arg arg ...?
  2.                This command performs one of several operations on  the
  3.                variable  given  by  arrayName.   ArrayName must be the
  4.                name  of  an  existing  array  variable.   The   option
  5.                argument  determines  what action is carried out by the
  6.                command.  The legal options (which may be  abbreviated)
  7.                are:
  8.  
  9.                array anymore arrayName searchId
  10.                     Returns  1  if there are any more elements left to
  11.                     be processed in an array search, 0 if all elements
  12.                     have  already  been  returned.  SearchId indicates
  13.                     which search on arrayName to check, and must  have
  14.                     been  the  return value from a previous invocation
  15.                     of array startsearch.  This option is particularly
  16.                     useful  if  an  array has an element with an empty
  17.                     name,  since   the   return   value   from   array
  18.                     nextelement  won't indicate whether the search has
  19.                     been completed.
  20.  
  21.                array donesearch arrayName searchId
  22.                     This   command  terminates  an  array  search  and
  23.                     destroys  all  the  state  associated  with   that
  24.                     search.    SearchId   indicates  which  search  on
  25.                     arrayName to  destroy,  and  must  have  been  the
  26.                     return  value  from a previous invocation of array
  27.                     startsearch.  Returns an empty string.
  28.  
  29.                array names arrayName
  30.                     Returns  a list containing the names of all of the
  31.                     elements in the array.  If there are  no  elements
  32.                     in the array then an empty string is returned.
  33.  
  34.                array nextelement arrayName searchId
  35.                     Returns the name of the next element in arrayName,
  36.                     or an empty string if all  elements  of  arrayName
  37.                     have  already  been  returned in this search.  The
  38.                     searchId argument identifies the search, and  must
  39.                     have been the return value of an array startsearch
  40.                     command.  Warning:  if elements are  added  to  or
  41.                     deleted  from  the  array,  then  all searches are
  42.                     automatically  terminated   just   as   if   array
  43.                     donesearch had been invoked; this will cause array
  44.                     nextelement operations to fail for those searches.
  45.  
  46.                array size arrayName
  47.                     Returns  a  decimal  string  giving  the number of
  48.                     elements in the array.
  49.  
  50.                array startsearch arrayName
  51.                     This  command  initializes  an  element-by-element
  52.                     search through the array given by arrayName,  such
  53.                     that  invocations of the array nextelement command
  54.                     will return the names of the  individual  elements
  55.                     in the array.  When the search has been completed,
  56.                     the array donesearch command  should  be  invoked.
  57.                     The  return value is a search identifier that must
  58.                     be used in array nextelement and array  donesearch
  59.                     commands;   it  allows  multiple  searches  to  be
  60.                     underway simultaneously for the same array.
  61.