FUNCTION Main()
LOCAL cShort := "1234567890"
LOCAL i, j, cLong, cBuffer, nHandle
cLong := cShort
FOR i := 1 TO 13
cLong += cLong
NEXT
SET PRINTER TO long_str
SET DEVICE TO PRINTER
DEVOUT( cLong )
SET PRINTER OFF
SET DEVICE TO SCREEN
? "The length of the long string is", iif( LEN( cLong ) == 80 * 1024, "correct", "wrong" )
cBuffer := cLong
? "The length of a copy of the long string is", iif( LEN( cLong ) == 80 * 1024, "correct", "wrong" )
? "The copy of the long string is", iif( cLong == cBuffer, "equal", "not equal" ), "to the long string"
nHandle := FOPEN( "long_str.prn" )
cBuffer := FREADSTR( nHandle, 90000 )
? "Original:", LEN( cLong )
? "From file:", LEN( cBuffer )
? "The strings are", iif( cLong == cBuffer, "equal", "not equal" )
return nil