Link to home
Start Free TrialLog in
Avatar of Eduardo Fuerte
Eduardo FuerteFlag for Brazil

asked on

What means vfp message: object is not contained in a form

Hi Experts

Do you know what it means and the workaround ?

"object is not contained in a form"

Amazingly it appears in a chunck of code aparently with no relation with the bug.

Thanks in advance.

Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Do you use scope resolution operator (::) somewhere?

And what is the code executed?
Avatar of Eduardo Fuerte

ASKER

Hello Pcelba !

I  really didn't use ::

the code is in the picture, a method from cls_db class that just pass to the next record...
img-vfp-erro.JPG
So, it seems your Command3.Click should move record pointer in current workarea.

This could also mean some Form event is trying to fire when the record pointer moves. The error could be caused by fact the "prox" method is not in a form but in some standalone class.

You may try to create a new Form method called "proxTemp" containing "SKIP" code from your picture and change the Command3.Click code to call this method instead of VCX library code. The debugger then should show what code is called on the SKIP command if you click on the "Step Into" debugger button.
I did that no other code, only skip... by the way the table data is filtered

The class is also used in another project with no errors in the form's init event

thisform.fodb   = CREATEOBJECT("cls_Db")

being fodb a form's property.

If data are filtered then what is in filter expression?
And also, could you print out call stack when the error occurs?

BTW, do you have some error handling procedure in your code which could save the app state when the error appears?
Hello

Here is the error log.
Erros-Livesp.log
Sorry

I've put the incorrect one, please consider this.
Erros-Livesp.log
Ops...

The filter:

*-- During development it's fixed in
thisform.s_emp="0000000004"

SELECT DESP
SET FILTER TO SB_EMP = thisform.s_emp
LOCATE
Here, again...

That's the problem:

Using the form property in the filter expression has made the "mass"

if I use

SELECT DESP
SET FILTER TO SB_EMP = "0000000004"  && instead of  SET FILTER TO SB_EMP = thisform.s_emp
LOCATE

Everithing is fine, but the filter must to be dynamic in the production system,so, to workaround I've declared m.sb_emp="" as a public variable in the main program(*) and in form method did:

(*) since m.sb_emp will be util in another contexts of the system too

m.sb_emp = thisform.s_emp

*--Despesas apenas da Empresa
SELECT DESP
SET FILTER TO SB_EMP = m.sb_emp
*--SET FILTER TO SB_EMP = thisform.s_emp
LOCATE

And everithing is fine again....

Any other suggestions ?

Thanks.
Use macro substitution

m.sb_emp = thisform.s_emp
SET FILTER TO SB_EMP = "&sb_emp"
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello

I hadn't a chance to test your solution by the way it looks fine

I guess I declare

_screen.AddProperty("MyFilter","FilterValue")
SET FILTER TO SB_EMP = _screen.MyFilter
at  the main prg

One last thing what does "BTW" means ? (it sounds like an Aircraft Company, rsrs)

 
BTW menas "By the way" in this context. It is common SMS (Short Messaging Service) abbreviation used in e-mails also.

More details: http://en.wikipedia.org/wiki/SMS_language
This is also interesting: http://www.abbreviations.com/BTW
Good... I'm planning next semester to return to my English classes.