home *** CD-ROM | disk | FTP | other *** search
- *******************
-
- FUNCTION Wipechar
-
- PARAMETERS _file
-
- IF PCOUNT() != 1
- RETURN(.F.)
- ENDIF
- IF TYPE("_file") != "C"
- RETURN(.F.)
- ENDIF
-
- PRIVATE _fhandle, _temp, _length
-
- _fhandle = FOPEN(_file, 2)
- FSEEK(_fhandle, -6, 2)
- _temp = FREADSTR(_fhandle, 4)
- IF _temp != "SJSC"
- RETURN(.F.)
- ENDIF
- FSEEK(_fhandle, -4, 1) && To get back to the original position
- FSEEK(_fhandle, -10, 1) && Get the length of the character string to read
- _length = VAL(FREADSTR(_fhandle, 10))
- FSEEK(_fhandle, -10, 1) && Get the length of the character string to read
- FSEEK(_fhandle, _length * -1, 1)
- FSEEK(_fhandle, -2, 1) && To get back to the original point of the file
- FWRITE(_fhandle, "", 0)
- FCLOSE(_fhandle)
- RETURN(.T.)
-
- * End of File