DATA statement problem

Started by James Fuller, April 13, 2010, 08:19:28 AM

Previous topic - Next topic

James Fuller

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

Paul Squires

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.
Paul Squires
PlanetSquires Software

James Fuller

CRAP!
This is a real show stopper with the project I'm working on!

James


Paul Squires

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.
Paul Squires
PlanetSquires Software

Paul Squires

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.
Paul Squires
PlanetSquires Software

James Fuller

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

Paul Squires

This problem has now been corrected. The fix will be in the next update (version 3.08).
Paul Squires
PlanetSquires Software