Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Factory Objects - practical application
Message
De
19/12/2006 04:34:35
 
 
À
18/12/2006 17:07:05
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01177742
Message ID:
01178796
Vues:
29
> 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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform