Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Factory Objects - practical application
Message
From
19/12/2006 04:34:35
 
 
To
18/12/2006 17:07:05
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01177742
Message ID:
01178796
Views:
28
> especially since the destroy resets whatever it tracked.
I hope while playing around with it you understand, that this does not work for SET("Datasession"). Here's a proof. A form with private datasession is instanciated (it will run in datasessionID 2, if you start in a fresh VFP IDE), then in a form method I create such a PushPop-Object and then set the datasession back to 1. The forms datasession then should in your opinion be reset, but it isn't!
oForm =CreateObject("myForm")
?"initial",oForm.DatasessionID
oForm.tempSession()
?"final",oForm.DatasessionID

Define Class myForm as Form
   Datasession=2 && private datasession
   Procedure tempSession()
      Local loSetPushPop
      loSetPushPop=CreateObject("Setpushpop")
      Set Datasession To 1
      ?"set",Thisform.DatasessionID
      *reset by destroy of loSetPushPop?
   EndProc 
EndDefine 

Define Class Setpushpop as Custom
   nDatasession=0
   Procedure Init()
      This.nDatasession=Set("Datasession")
      ?"saved",This.nDatasession
   EndProc
   
   Procedure Destroy()
      Set Datasession To This.nDatasession
      ?"reset",Set("Datasession")
   EndProc 
EndDefine
Bye, Olaf.
Previous
Reply
Map
View

Click here to load this message in the networking platform