home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST18.PRG < prev    next >
Encoding:
Text File  |  1989-08-08  |  809 b   |  31 lines

  1. ********************
  2.  
  3. FUNCTION Length_el
  4.  
  5.    PARAMETERS _aarray, _delimit
  6.  
  7.    _delimit = IF((TYPE("_delimit") = "U"), "/", _delimit)
  8.  
  9.    IF PCOUNT() = 0
  10.       RETURN(-1)
  11.    ELSEIF TYPE("_aarray") != "A"
  12.       IF TYPE("_aarray") != "C"
  13.          RETURN(-1)
  14.       ELSE
  15.          * turn the string into an array
  16.          _choices = _aarray
  17.          DECLARE _aarray[Occurence(_delimit, _choices) + 1]
  18.          _uptohere = Occurence(_delimit, _choices) + 1
  19.          FOR _qaz = 1 TO LEN(_aarray)
  20.             _aarray[_qaz] = Parsing(@_choices)
  21.          NEXT
  22.       ENDIF
  23.    ENDIF
  24.  
  25.    * This funntion returns the length of the longest element in the
  26.    * array. Good for formatting purposes
  27.    
  28.    RETURN(IF( (Long_elem(_aarray) < 1) , 0, LEN(_aarray[Long_elem(_aarray)])))
  29.  
  30. * End of File
  31.