Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataSession troubles.
Message
From
02/01/2001 21:20:18
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00457954
Message ID:
00458734
Views:
20
Hi Doru,
Glad you were able to debug my code. I can't type more than a few lines without making an error. I did try to run it tonight, and found the problems you mentioned. As to the form that won't die, I don't think it is related to the Example object, but you can be sure with a test: just get a reference to the form (I usually do the ON KEY LABEL F12 o = SYS(1270) thing, then press F12 with the mouse cursor over the form's caption), type o.CallMeObject= .NULL., then see if the private session's gone (SET) and see if the form closes properly. I tried it and it worked OK. I would expect, as you, that some objects have a reference to the form, or an object on the form has a reference to another object on the form.
Christof Lange's explanation of DataSessions was very helpful to me. http://fox.wikis.com/wc.dll?Wiki~DataSession~VFP An object is bound to the current datasession when it was born. This allows you to design visual classes with a private session; just instantiate them in a session.

>Hi Charlie,
>
>Thank you for the info - I guess one of the errors - "Cannot access selected table" was caused by SET DATASESSION TO...as you said.

>I tried your code.
>I needed to do some small corrections like DEFINE CLASS, and ENDDEFINE at the end of the first DEFINE, also seek() had the alias and order parameters switched around, and added a return to the callme() procedure.
>
>I created a form CallMeTest, added a custom property CallMeObject and initialized the object in the init of the form:
>
this.CallMeObject = NEWOBJECT("Example", "CallMe.prg")
>On the form I have textboxes for the employee names, and in the refresh of textboxex I have:
>
this.value = thisform.CallMeObject.callme(thisform.txtEmpID.value)
>
>All works fine, as I navigate through the “base file” (file that has employee IDs). One problem though:
>After I exit the form, something like a ghost form object is left “alive” – I can see it in the Locals window in Debugger – it has no properties or methods. I guess the thisform.release that executes on the Exit button click() fails because some other objects still exist at the time??
>
>Thank you,
>dz
Charlie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform