Hello everyone,
This code has worked for years, now sadly it is failing intermittently. It's in an internal application. I think the error is invalid or the line number and what method the error occurs in is invalid.
In a CommandGroup class, the INIT method calls the following SetChildColor method: * Set the forecolor property THIS.SETALL("ForeColor", ; EVALUATE( LEFT( RGBSCHEME(1,2), ; AT(',', RGBSCHEME(1,2), 3) -1)+')'), "CommandButton")
THIS.SETALL("DisabledForeColor", ; EVALUATE( LEFT( RGBSCHEME(1,10), ; AT(",", RGBSCHEME(1,10), 3)-1)+")"), "CommandButton")
Line four is throwing the error Variable is not found.
To determine if it was odd timing related to the EVALUATE function we changed the code to: * Set the forecolor property LOCAL enabledColor, disabledColor enabledColor = EVALUATE( LEFT( RGBSCHEME(1,2), AT(',', RGBSCHEME(1,2), 3) -1)+')') disabledColor = EVALUATE( LEFT( RGBSCHEME(1,10), AT(",", RGBSCHEME(1,10), 3)-1)+")")
THIS.SETALL("ForeColor", enabledColor, "CommandButton")
THIS.SETALL("DisabledForeColor", disabledColor, "CommandButton")
We now get the error on line 6.
The stack shows the form is called, the commandgroup.init is running and calls this method.
I'm looking for some additional ideas to find this intermittent problem.
Thank you, Tracy
Maybe iterate through the objects rather than use SetAll and find the trouble child?
E
On Tue, Jun 23, 2020 at 12:01 PM Tracy Pearson tracy@powerchurch.com wrote:
Hello everyone,
This code has worked for years, now sadly it is failing intermittently. It's in an internal application. I think the error is invalid or the line number and what method the error occurs in is invalid.
In a CommandGroup class, the INIT method calls the following SetChildColor method: * Set the forecolor property THIS.SETALL("ForeColor", ; EVALUATE( LEFT( RGBSCHEME(1,2), ; AT(',', RGBSCHEME(1,2), 3) -1)+')'), "CommandButton")
THIS.SETALL("DisabledForeColor", ; EVALUATE( LEFT( RGBSCHEME(1,10), ; AT(",", RGBSCHEME(1,10), 3)-1)+")"), "CommandButton")Line four is throwing the error Variable is not found.
To determine if it was odd timing related to the EVALUATE function we changed the code to: * Set the forecolor property LOCAL enabledColor, disabledColor enabledColor = EVALUATE( LEFT( RGBSCHEME(1,2), AT(',', RGBSCHEME(1,2), 3) -1)+')') disabledColor = EVALUATE( LEFT( RGBSCHEME(1,10), AT(",", RGBSCHEME(1,10), 3)-1)+")")
THIS.SETALL("ForeColor", enabledColor, "CommandButton") THIS.SETALL("DisabledForeColor", disabledColor, "CommandButton")We now get the error on line 6.
The stack shows the form is called, the commandgroup.init is running and calls this method.
I'm looking for some additional ideas to find this intermittent problem.
Thank you, Tracy
[excessive quoting removed by server]
Wrap the whole thing in a TRY..CATCH and see what the exception object can tell you.
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Eric Selje Sent: Tuesday, June 23, 2020 2:16 PM To: profoxtech@leafe.com Subject: Re: SetAll throws Variable Not Found
Maybe iterate through the objects rather than use SetAll and find the trouble child?
E
On Tue, Jun 23, 2020 at 12:01 PM Tracy Pearson tracy@powerchurch.com wrote:
Hello everyone,
This code has worked for years, now sadly it is failing intermittently. It's in an internal application. I think the error is invalid or the line number and what method the error occurs in is invalid.
In a CommandGroup class, the INIT method calls the following SetChildColor method: * Set the forecolor property THIS.SETALL("ForeColor", ; EVALUATE( LEFT( RGBSCHEME(1,2), ; AT(',', RGBSCHEME(1,2), 3) -1)+')'), "CommandButton")
THIS.SETALL("DisabledForeColor", ; EVALUATE( LEFT( RGBSCHEME(1,10), ; AT(",", RGBSCHEME(1,10), 3)-1)+")"), "CommandButton")Line four is throwing the error Variable is not found.
To determine if it was odd timing related to the EVALUATE function we changed the code to: * Set the forecolor property LOCAL enabledColor, disabledColor enabledColor = EVALUATE( LEFT( RGBSCHEME(1,2), AT(',', RGBSCHEME(1,2), 3) -1)+')') disabledColor = EVALUATE( LEFT( RGBSCHEME(1,10), AT(",", RGBSCHEME(1,10), 3)-1)+")")
THIS.SETALL("ForeColor", enabledColor, "CommandButton") THIS.SETALL("DisabledForeColor", disabledColor, "CommandButton")We now get the error on line 6.
The stack shows the form is called, the commandgroup.init is running and calls this method.
I'm looking for some additional ideas to find this intermittent problem.
Thank you, Tracy
[excessive quoting removed by server]
Thank you Eric and Richard,
I've decided on the Try/Catch with an attempt to handle it again, just in case this is just a timing issue.
When the code is implemented, the error will hopefully be swallowed, and the support staff will be able to continue their day.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye Sent: Tuesday, June 23, 2020 4:28 PM To: profoxtech@leafe.com Subject: RE: SetAll throws Variable Not Found
Wrap the whole thing in a TRY..CATCH and see what the exception object can tell you.
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Eric Selje Sent: Tuesday, June 23, 2020 2:16 PM To: profoxtech@leafe.com Subject: Re: SetAll throws Variable Not Found
Maybe iterate through the objects rather than use SetAll and find the trouble child?
E
On Tue, Jun 23, 2020 at 12:01 PM Tracy Pearson tracy@powerchurch.com wrote:
Hello everyone,
This code has worked for years, now sadly it is failing intermittently. It's in an internal application. I think the error is invalid or the line number and what method the error occurs in is invalid.
In a CommandGroup class, the INIT method calls the following SetChildColor method: * Set the forecolor property THIS.SETALL("ForeColor", ; EVALUATE( LEFT( RGBSCHEME(1,2), ; AT(',', RGBSCHEME(1,2), 3) -1)+')'), "CommandButton")
THIS.SETALL("DisabledForeColor", ; EVALUATE( LEFT( RGBSCHEME(1,10), ; AT(",", RGBSCHEME(1,10), 3)-1)+")"), "CommandButton")Line four is throwing the error Variable is not found.
To determine if it was odd timing related to the EVALUATE function we changed the code to: * Set the forecolor property LOCAL enabledColor, disabledColor enabledColor = EVALUATE( LEFT( RGBSCHEME(1,2), AT(',', RGBSCHEME(1,2), 3) -1)+')') disabledColor = EVALUATE( LEFT( RGBSCHEME(1,10), AT(",", RGBSCHEME(1,10), 3)-1)+")")
THIS.SETALL("ForeColor", enabledColor, "CommandButton") THIS.SETALL("DisabledForeColor", disabledColor, "CommandButton")We now get the error on line 6.
The stack shows the form is called, the commandgroup.init is running and calls this method.
I'm looking for some additional ideas to find this intermittent problem.
Thank you, Tracy
[excessive quoting removed by server]
Turns out, this may be the correct message, just not the right line of code, because the error is internal to VFP itself. The two forms this base class is on that also errored (because this base class is on several forms) had a ControlSource set on the control. The ControlSource was just a variable name. This variable had not been declared or initialized prior to calling the form. What I have seen happen in the past, VFP will generate the variable as a Private that goes out of scope when the form closes.
We've cleared the ControlSource that isn't needed on one form and fixed a typo on the second form. We'll see if that error pops up anymore.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Tracy Pearson Sent: Tuesday, June 23, 2020 5:06 PM To: profoxtech@leafe.com Subject: RE: SetAll throws Variable Not Found
Thank you Eric and Richard,
I've decided on the Try/Catch with an attempt to handle it again, just in case this is just a timing issue.
When the code is implemented, the error will hopefully be swallowed, and the support staff will be able to continue their day.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye Sent: Tuesday, June 23, 2020 4:28 PM To: profoxtech@leafe.com Subject: RE: SetAll throws Variable Not Found
Wrap the whole thing in a TRY..CATCH and see what the exception object can tell you.
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Eric Selje Sent: Tuesday, June 23, 2020 2:16 PM To: profoxtech@leafe.com Subject: Re: SetAll throws Variable Not Found
Maybe iterate through the objects rather than use SetAll and find the trouble child?
E
On Tue, Jun 23, 2020 at 12:01 PM Tracy Pearson tracy@powerchurch.com wrote:
Hello everyone,
This code has worked for years, now sadly it is failing intermittently. It's in an internal application. I think the error is invalid or the line number and what method the error occurs in is invalid.
In a CommandGroup class, the INIT method calls the following SetChildColor method: * Set the forecolor property THIS.SETALL("ForeColor", ; EVALUATE( LEFT( RGBSCHEME(1,2), ; AT(',', RGBSCHEME(1,2), 3) -1)+')'), "CommandButton")
THIS.SETALL("DisabledForeColor", ; EVALUATE( LEFT( RGBSCHEME(1,10), ; AT(",", RGBSCHEME(1,10), 3)-1)+")"), "CommandButton")Line four is throwing the error Variable is not found.
To determine if it was odd timing related to the EVALUATE function we changed the code to: * Set the forecolor property LOCAL enabledColor, disabledColor enabledColor = EVALUATE( LEFT( RGBSCHEME(1,2), AT(',', RGBSCHEME(1,2), 3) -1)+')') disabledColor = EVALUATE( LEFT( RGBSCHEME(1,10), AT(",", RGBSCHEME(1,10), 3)-1)+")")
THIS.SETALL("ForeColor", enabledColor, "CommandButton") THIS.SETALL("DisabledForeColor", disabledColor, "CommandButton")We now get the error on line 6.
The stack shows the form is called, the commandgroup.init is running and calls this method.
I'm looking for some additional ideas to find this intermittent problem.
Thank you, Tracy
[excessive quoting removed by server]