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

  1. ********************
  2.  
  3. FUNCTION Asizetxt
  4.  
  5.    PARAMETERS _thefile
  6.  
  7.    IF !FILE(_thefile)
  8.       RETURN(0)
  9.    ELSEIF PCOUNT() != 1
  10.       RETURN(0)
  11.    ELSEIF TYPE("_thefile") != "C"
  12.       RETURN(0)
  13.    ENDIF
  14.     
  15.    PRIVATE _fhandle, _string, _counter, _number
  16.  
  17.    _fhandle = FOPEN(_thefile, 2)
  18.    _counter = 0
  19.  
  20.    DO WHILE .T.
  21.       _string  = SPACE(512)
  22.       _number = FREAD(_fhandle, @_string, 512)
  23.       _string = STRTRAN(STRTRAN(_string, CHR(13)+CHR(10), "|"), "||", "|")
  24.       _counter = _counter + Occurence("|", _string)
  25.       IF _number != 512
  26.          EXIT
  27.       ENDIF
  28.    ENDDO
  29.    FCLOSE(_fhandle)
  30.    RETURN(_counter)
  31.       
  32. * End of File
  33.