![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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?? |
#3
| |||
| |||
|
|
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?? |
#4
| |||
| |||
|
|
My problem is: the Class2.form1 is shown on the scrren, but when the clic button method ends, the Class2.form1 is release... |
|
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. |
|
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?? |
#5
| |||
| |||
|
|
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 |
|
Thisform.class2 = CREATEOBJECT("CLASS2") ... |
| -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?? |
![]() |
| Thread Tools | |
| Display Modes | |
| |