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

  1. ********************
  2.  
  3. FUNCTION Long_numb
  4.  
  5.    PARAMETERS _array, _oldest
  6.  
  7.    PRIVATE _theret, _element, _downtoit
  8.  
  9.    IF PCOUNT() = 0
  10.       RETURN(-1)
  11.    ELSEIF PCOUNT() = 1
  12.       _oldest = .T.
  13.    ELSEIF TYPE("_array") != "A"
  14.       RETURN(-1)
  15.    ENDIF
  16.  
  17.    _theret = 0
  18.  
  19.    IF _oldest
  20.       _element = 0
  21.    ELSE
  22.       _element = 999999999999999999
  23.    ENDIF
  24.  
  25.    FOR _downtoit = 1 TO LEN(_array)
  26.       d_type = _array[_downtoit]
  27.       IF TYPE("d_type") = "N"
  28.          IF _oldest
  29.             IF d_type > _element
  30.                _element = d_type
  31.                _theret = _downtoit
  32.             ENDIF
  33.          ELSE
  34.             IF d_type <= _element
  35.                _element = d_type
  36.                _theret = _downtoit
  37.             ENDIF
  38.          ENDIF
  39.       ENDIF
  40.    NEXT
  41.    RETURN(_theret)
  42.  
  43. * End of File
  44.