$ESCAPECHARS ON
$TYPECHECK ON
$INCLUDE "RAPIDQ.INC"
DECLARE FUNCTION CallAsmProc LIB "user32" ALIAS "CallWindowProcA" _
(Proc AS LONG, A1 AS LONG, A2 AS LONG, A3 AS LONG, _
A4 AS LONG) AS LONG
DEFBYTE CheckStringArray (0 TO 75) = _
{ _
&HC8, &H00, &H00, &H00, &H56, &H57, &H51, &H52, &H8B, &H75, _
&H08, &H8B, &H7D, &H10, &H8B, &H4D, &H0C, &HBA, &H00, &H00, _
&H00, &H00, &H4E, &H41, &H46, &H49, &H0F, &H84, &H22, &H00, _
&H00, &H00, &H8A, &H06, &H3C, &H21, &H72, &HF2, &H3C, &H80, _
&H73, &HEE, &H3C, &H61, &H0F, &H82, &H0A, &H00, &H00, &H00, _
&H3C, &H7B, &H0F, &H83, &H02, &H00, &H00, &H00, &H2C, &H20, _
&H88, &H07, &H42, &H47, &HEB, &HD6, &H89, &HD0, &H5A, &H59, _
&H5F, &H5E, &HC9, &HC2, &H10, &H00 _
}
DEFINT ptrCheckString
ptrCheckString = VARPTR (CheckStringArray(0))
FUNCTION CheckString (ptrBinString AS LONG, lenBinString AS LONG) AS STRING
DEFSTR returnedString
DEFINT lenReturnedString, ptrReturnedString
returnedString = SPACE$(lenBinString)
ptrReturnedString = VARPTR(returnedString)
lenReturnedString = CallAsmProc (ptrCheckString, ptrBinString,lenBinString, ptrReturnedString, 0)
CheckString = LEFT$(returnedString, lenReturnedString)
END FUNCTION
DEFSTR testStr
testStr = SPACE$(256)
DEFINT N
FOR N = 0 TO 255
testStr = REPLACE$(testStr, CHR$(N), N + 1)
NEXT N
PRINT ("Original string : \n" & testStr & "\n\n\n\n")
PRINT ("Modified String : \n" & CheckString(VARPTR(testStr), LEN(testStr)))
DEFSTR sExit
INPUT "\n\n CR to QUIT \n\n", sExit
Application.Terminate
END
|
|