PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: James Fuller on April 13, 2010, 08:19:28 AM

Title: DATA statement problem
Post by: James Fuller on April 13, 2010, 08:19:28 AM
I have a problem with DATA statements in a CLASS.
This is working stand-alone (not FF) PBWIN code:


'SED_PBWIN
CLASS cTest
INSTANCE S1 AS STRING
INTERFACE iTest : INHERIT IUNKNOWN
METHOD Init()
LOCAL y AS LONG
LOCAL S AS STRING
FOR y = 1 TO 3
S = S + READ$(y)+$CR
NEXT Y
? S

DATA "Line 1"
DATA "Line 2"
DATA "Line 3"

END METHOD
END INTERFACE
END CLASS

FUNCTION PBMAIN
LOCAL oTest AS iTest
oTest = CLASS "cTest"
IF ISNOTHING(oTest) THEN
? "NO oTest"
EXIT FUNCTION
END IF
oTest.Init

END FUNCTION


Attached is the FF Project that fails to compile.

James
Title: Re: DATA statement problem
Post by: Paul Squires on April 13, 2010, 08:37:08 AM
Hi James,

When FF generates the code, it moves Classes to the CODEGEN*_DECLARES.INC file. It also adds some debug code to the end of each line to help FF find the original source code line in the event that an error occurs during compiling. The problem in this case is that the PB compiler does not like the REM comment at the end of a DATA statement.

         Data "Line 1"   ':FILE:CODEGEN_DATATEST_MODULE1INC_MODULE.inc|12|0
         Data "Line 2"   ':FILE:CODEGEN_DATATEST_MODULE1INC_MODULE.inc|13|0
         Data "Line 3"   ':FILE:CODEGEN_DATATEST_MODULE1INC_MODULE.inc|14|0

I'll look into seeing how I can work around that.
Title: Re: DATA statement problem
Post by: James Fuller on April 13, 2010, 09:05:15 AM
CRAP!
This is a real show stopper with the project I'm working on!

James

Title: Re: DATA statement problem
Post by: Paul Squires on April 13, 2010, 09:48:52 AM
I should have something for you soon - at least a new FF exe to bypass this problem. It should allow you to at least to continue working on your project. I'll email you when it is ready.
Title: Re: DATA statement problem
Post by: Paul Squires on April 13, 2010, 10:11:43 AM
James,

Here is a quick fix. Just add a semicolon at the end of each of your DATA lines.

         Data "Line 1"  :
         Data "Line 2"  :
         Data "Line 3"  :

That should work until I get FF recompiled.
Title: Re: DATA statement problem
Post by: James Fuller on April 13, 2010, 11:22:35 AM
Paul,
Thanks for the quick work-around. Works fine. Take your time on the actual FF fix. Client would also need it if I went the original code.

James
Title: Re: DATA statement problem
Post by: Paul Squires on April 28, 2010, 03:34:52 PM
This problem has now been corrected. The fix will be in the next update (version 3.08).