Hi gang,
seems like I should be able to do the following, but it generates an error.
I have tried making the member private but that did not help.
Changing either the const 'variable' name or the member name to non-matching names works OK.
Would appreciate any help.
Thanks in advance.
Const problem = 0
Class foobar
'private
def problem as INT
end CLASS
def test as foobar
test.problem = 999
generates : "undefined variable - problem" at the line test.problem = 999
Get rid of Const problem = 0
If you were trying to initialize problem it should be done in the class construct and shouldn't be a constant.
Larry
Larry,
thanks for the quick reply but, no.
It is not meant to be an initialization of a class member.
That would be done inside the class.
This constant is global to the rest of the program.
The question is why can't we have a global constant and a class member of the same name.
You can, in version 1.66, which I will be releasing soon. This is the bug reported by Sapero here:
http://www.ionicwind.com/forums/index.php/topic,2830.0.html
Classes and types (structures) use the same mechanism for defining variables.