Jan Hoelterling
2008-10-19 03:14:45 UTC
I have a single CC called XPControls.CC containing custom classes for every
stock form object class. Each of these classes may have additional methods,
for example, I added an "enable" and "disable" method to every object
(rather than setting enabled = true/false). My main purpose is to control
visual behaviour in one place
When adding a single line today, I started getting unexplicable "variable
THIS not defined" pointing to:
CLASS XPToolbtn(oParent) of XPImage(oParent) custom
needless to say, oParent is a valid object reference.
As soon as I remove the line, everything works ok again. The offending line
is in my "enable" method for a grid:
function enable
this.enabled = true
this.colornormal = "WindowText/Window"
this.colorhighlight = "Windowtext/0xFFFFCC" ** This line causes the
problem
return
I then tried to remove a rarely used class (XPShape) from this CC, and I was
able to add the line
this.colorhighlight = "Windowtext/0xFFFFCC"
again, without any problems.
So, it seems to me that I must have somehow exceeded some size limit within
this CC. Why doesn't the compiler produce some error message rather than
causing problems in the execution later, with the error pointing to another
piece of code? For the compiler to produce code that looses "THIS" seems
pretty crucial.
Thanks in advance for your help.
Jan
stock form object class. Each of these classes may have additional methods,
for example, I added an "enable" and "disable" method to every object
(rather than setting enabled = true/false). My main purpose is to control
visual behaviour in one place
When adding a single line today, I started getting unexplicable "variable
THIS not defined" pointing to:
CLASS XPToolbtn(oParent) of XPImage(oParent) custom
needless to say, oParent is a valid object reference.
As soon as I remove the line, everything works ok again. The offending line
is in my "enable" method for a grid:
function enable
this.enabled = true
this.colornormal = "WindowText/Window"
this.colorhighlight = "Windowtext/0xFFFFCC" ** This line causes the
problem
return
I then tried to remove a rarely used class (XPShape) from this CC, and I was
able to add the line
this.colorhighlight = "Windowtext/0xFFFFCC"
again, without any problems.
So, it seems to me that I must have somehow exceeded some size limit within
this CC. Why doesn't the compiler produce some error message rather than
causing problems in the execution later, with the error pointing to another
piece of code? For the compiler to produce code that looses "THIS" seems
pretty crucial.
Thanks in advance for your help.
Jan