dbTalk Databases Forums  

Formset problem

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss Formset problem in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Francisco Rivera
 
Posts: n/a

Default Formset problem - 04-19-2004 , 11:14 AM






Hello.

I've created two classes, Class1 and Class2, taking as base FormSet
class.

A form in Class1 must call another form in Class2 pressing a button.
in the clic method of that button i have something like this:
Class2.form1.show

My ploblem is: the Class2.form1 is shown on the scrren, but when the
clic button method ends, the Class2.form1 is release...

Can you help me??

Reply With Quote
  #2  
Old   
Stefan Wuebbe
 
Posts: n/a

Default Re: Formset problem - 04-20-2004 , 07:57 AM






Maybe I misunderstood your description - is "class2" a public
reference or is it a variable created in the current method or
procedure?
If the latter, it might be released, "go out of scope", when your
method is over (as Vfp variables do by default as long as they
are not declared as Public).
Perhaps you can use a property of the current (parent) form
instead of a Local or Private variable.


hth
-Stefan

"Francisco Rivera" <frivera (AT) tlaxcala (DOT) com> schrieb im Newsbeitrag
news:3875a57a.0404190814.2682aefe (AT) posting (DOT) google.com...
Quote:
Hello.

I've created two classes, Class1 and Class2, taking as base FormSet
class.

A form in Class1 must call another form in Class2 pressing a button.
in the clic method of that button i have something like this:
Class2.form1.show

My ploblem is: the Class2.form1 is shown on the scrren, but when the
clic button method ends, the Class2.form1 is release...

Can you help me??


Reply With Quote
  #3  
Old   
Francisco Rivera
 
Posts: n/a

Default Re: Formset problem - 04-20-2004 , 01:10 PM



Hi Stefan.

Initially, class2 is an empty public variable wich in the button's
click method is an object assigned to it:

class2 = CREATEOBJECT("CLASS2")

I don't believe that the error is caused by the scope of the variable,
because is declared as PUBLIC, not as procedure variable or local
variable.


"Stefan Wuebbe" <stefan.wuebbe (AT) gmx (DOT) de> wrote

Quote:
Maybe I misunderstood your description - is "class2" a public
reference or is it a variable created in the current method or
procedure?
If the latter, it might be released, "go out of scope", when your
method is over (as Vfp variables do by default as long as they
are not declared as Public).
Perhaps you can use a property of the current (parent) form
instead of a Local or Private variable.


hth
-Stefan

"Francisco Rivera" <frivera (AT) tlaxcala (DOT) com> schrieb im Newsbeitrag
news:3875a57a.0404190814.2682aefe (AT) posting (DOT) google.com...
Hello.

I've created two classes, Class1 and Class2, taking as base FormSet
class.

A form in Class1 must call another form in Class2 pressing a button.
in the clic method of that button i have something like this:
Class2.form1.show

My ploblem is: the Class2.form1 is shown on the scrren, but when the
clic button method ends, the Class2.form1 is release...

Can you help me??

Reply With Quote
  #4  
Old   
Stefan Wuebbe
 
Posts: n/a

Default Re: Formset problem - 04-21-2004 , 03:17 AM



Hi Francisco

Quote:
My problem is: the Class2.form1 is shown on the scrren, but when the
clic button method ends, the Class2.form1 is release...
Hmm, this sounds exactly like a out-of-scope issue ...

Quote:
I don't believe that the error is caused by the scope of the variable,
because is declared as PUBLIC, not as procedure variable or local
variable.
.... but you're right, this sounds as if it where not.
Can you post the code of your commandbutton.Click()
method? Or even a complete runnable demo code PRG?

Can you still see "class2" in the debugger's Watch window
when your Click() method is over?
Do you Release class2 somewhere in your code between the
Public statement and before the CreateObject / Show ?
Does the behaviour change when you use a property of the
persisting parent form object instead?
*!* class2 = CREATEOBJECT("CLASS2")
If Not PemStatus(Thisform, "Class2", 5)
Thisform.AddProperty("Class2")
Endif
Thisform.class2 = CREATEOBJECT("CLASS2")
...


-Stefan

"Francisco Rivera" <frivera (AT) tlaxcala (DOT) com> schrieb
Quote:
Hi Stefan.

Initially, class2 is an empty public variable wich in the button's
click method is an object assigned to it:

class2 = CREATEOBJECT("CLASS2")

I don't believe that the error is caused by the scope of the variable,
because is declared as PUBLIC, not as procedure variable or local
variable.


"Stefan Wuebbe" <stefan.wuebbe (AT) gmx (DOT) de> wrote

Maybe I misunderstood your description - is "class2" a public
reference or is it a variable created in the current method or
procedure?
If the latter, it might be released, "go out of scope", when your
method is over (as Vfp variables do by default as long as they
are not declared as Public).
Perhaps you can use a property of the current (parent) form
instead of a Local or Private variable.


hth
-Stefan

"Francisco Rivera" <frivera (AT) tlaxcala (DOT) com> schrieb im Newsbeitrag
news:3875a57a.0404190814.2682aefe (AT) posting (DOT) google.com...
Hello.

I've created two classes, Class1 and Class2, taking as base FormSet
class.

A form in Class1 must call another form in Class2 pressing a button.
in the clic method of that button i have something like this:
Class2.form1.show

My ploblem is: the Class2.form1 is shown on the scrren, but when the
clic button method ends, the Class2.form1 is release...

Can you help me??


Reply With Quote
  #5  
Old   
Francisco Rivera
 
Posts: n/a

Default Re: Formset problem - 04-21-2004 , 09:51 AM



Hi Stefan.

"Stefan Wuebbe" <stefan.wuebbe (AT) gmx (DOT) de> wrote

Quote:
Hi Francisco

My problem is: the Class2.form1 is shown on the scrren, but when the
clic button method ends, the Class2.form1 is release...

Hmm, this sounds exactly like a out-of-scope issue ...

I don't believe that the error is caused by the scope of the variable,
because is declared as PUBLIC, not as procedure variable or local
variable.

... but you're right, this sounds as if it where not.
Can you post the code of your commandbutton.Click()
method? Or even a complete runnable demo code PRG?

Can you still see "class2" in the debugger's Watch window
when your Click() method is over?
Do you Release class2 somewhere in your code between the
Public statement and before the CreateObject / Show ?
Does the behaviour change when you use a property of the
persisting parent form object instead?
*!* class2 = CREATEOBJECT("CLASS2")
If Not PemStatus(Thisform, "Class2", 5)
Thisform.AddProperty("Class2")
Endif
whit this line the problem was resolved:
Quote:
Thisform.class2 = CREATEOBJECT("CLASS2")
...
you were right... i referenced the class2 variable by its name, not as
property of class1.

Thank you very much for your time and your help.

Atte. Francisco Rivera.

Quote:

-Stefan

"Francisco Rivera" <frivera (AT) tlaxcala (DOT) com> schrieb
Hi Stefan.

Initially, class2 is an empty public variable wich in the button's
click method is an object assigned to it:

class2 = CREATEOBJECT("CLASS2")

I don't believe that the error is caused by the scope of the variable,
because is declared as PUBLIC, not as procedure variable or local
variable.


"Stefan Wuebbe" <stefan.wuebbe (AT) gmx (DOT) de> wrote in message
news:<c6376t$7g5b0$1 (AT) ID-13445 (DOT) news.uni-berlin.de>...
Maybe I misunderstood your description - is "class2" a public
reference or is it a variable created in the current method or
procedure?
If the latter, it might be released, "go out of scope", when your
method is over (as Vfp variables do by default as long as they
are not declared as Public).
Perhaps you can use a property of the current (parent) form
instead of a Local or Private variable.


hth
-Stefan

"Francisco Rivera" <frivera (AT) tlaxcala (DOT) com> schrieb im Newsbeitrag
news:3875a57a.0404190814.2682aefe (AT) posting (DOT) google.com...
Hello.

I've created two classes, Class1 and Class2, taking as base FormSet
class.

A form in Class1 must call another form in Class2 pressing a button.
in the clic method of that button i have something like this:
Class2.form1.show

My ploblem is: the Class2.form1 is shown on the scrren, but when the
clic button method ends, the Class2.form1 is release...

Can you help me??

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.