Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
*!* STRIPEOF.PRG
PARAMETERS qcFileName
* Open the file with unbuffered read/write access
lnhandle = FOPEN(qcFileName,12)
* Test for possible file opening error
IF lnhandle = -1
WAIT WINDOW "Error Opening File: " ;
+ ALLTRIM(qcFileName)TIMEOUT 10
RETURN
ENDIF
l_nSize = FSEEK(lnHandle,0,2) && Determine file size
l_nOrgSize = l_nSize && save so we know if we've stripped anything
= FSEEK(lnHandle, -3, 2) && Sneak a peak at the last 3 characters
l_cLastChars = FREAD(lnHandle,3)
l_nLastChar = INT(ASC(SUBSTR(l_cLastChars,3,1)))
IF l_nLastChar = 26 && 0x1A && ASCII eof [or CHR(26)]
*WAIT WINDOW "Stripping EOF" TIMEOUT 5 NOWAIT
l_nSize = l_nSize - 1
l_cLastChars = LEFT(l_cLastChars, 2) && throw away last
ENDIF
IF RIGHT(l_cLastChars, 2) = CHR(13)+CHR(10) && CRLF
*WAIT WINDOW "Stripping CRLF" TIMEOUT 5 NOWAIT
l_nSize = l_nSize - 2
ENDIF
IF l_nSize <> l_nOrgSize
= FCHSIZE(lnHandle, l_nSize) && make it shorter
ENDIF
= FCLOSE(lnHandle)
RETURN