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

  1. ********************
  2.  
  3. FUNCTION Afilltxt
  4.  
  5.    PARAMETERS _thefile, _thearray
  6.  
  7.    IF PCOUNT() != 2
  8.       RETURN(.F.)
  9.    ELSEIF TYPE("_thefile")+TYPE("_thearray") != "CA"
  10.       RETURN(.F.)
  11.    ELSEIF LEN(_thearray) = 0
  12.       RETURN(.F.)
  13.    ELSEIF !FILE(_thefile)
  14.       RETURN(.F.)
  15.    ENDIF
  16.  
  17.    PRIVATE _fhandle, _string, _counter, _number
  18.  
  19.    _fhandle = FOPEN(_thefile, 2)
  20.    _counter = 0
  21.  
  22.    DO WHILE .T.
  23.       _string  = SPACE(512)
  24.       _number = FREAD(_fhandle, @_string, 512)
  25.       _string = TRIM(STRTRAN(STRTRAN(STRTRAN(_string, CHR(13)+CHR(10), "|"), "||", "|"), CHR(26), ""))
  26.       DO WHILE !EMPTY(_string)
  27.          IF _counter > LEN(_thearray)
  28.             EXIT
  29.          ENDIF
  30.          _counter = _counter + 1
  31.          _thearray[_counter] = Parsing(@_string, "|")
  32.       ENDDO
  33.       IF _number != 512
  34.          EXIT
  35.       ELSE
  36.          _counter = _counter - 1
  37.       ENDIF
  38.    ENDDO
  39.    FCLOSE(_fhandle)
  40.    RETURN( (_counter) = LEN(_thearray) )
  41.  
  42. * End of File
  43.