Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Private datasession for a class
Message
De
11/06/2002 12:16:14
 
 
À
11/06/2002 11:57:16
Irv Adams
MSC Managed Care, Inc.
Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00666940
Message ID:
00666980
Vues:
23
Hi Irv,
You still have to maintain your GetZipCodeTable class in a prg, which is what I'm trying to avoid. You have a very simple class to maintain. I have a complex class.
But, this does give me idea.


>Why not use a Container to hold the Session class? I have a Combobox inside a Container Class (done thru visual designer). In the INIT of the Container I Instantiate a Session class (from a .PRG) with the following:
>
>
>THIS.AddObject('ZipData','GetZipCodeTable')  && Session for ZipCode Table
>
>
>All the Session class does is open a nationwide ZipCode lookup table, similar to this:
>
>
>Define Class GetZipCodeTable as SESSION
>
> Proc Init
>  USE ZipTable ALIAS ZipStates IN 0 Shared
> EndProc
>
> Proc Destroy
>  Close Data
> EndProc
>	
>EndDefine
>
>
>The Combobox uses this table to display the information. I can drop this control on any Form regardless of its DE or of any other tables currently open and it does its job seamlessly. When you Setfocus to this Combobox you see only its Private Session.
>
>HTH,
>
>-Irv.
>
>>Does any one know how I can have a Custom Class AUTOMATICALLY use a private datasession?
>>
>>I know that I can :
>>1. createobject('session')
>>2. switch to the new datasession
>>3. createobject('myCustomClass')
>>3. switch back to the old datasession
>>
>>But I want myCustomClass to do all that internally.
>>
>>TIA
Bill Morris
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform