Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Private datasession for a class
Message
From
11/06/2002 12:16:14
 
 
To
11/06/2002 11:57:16
Irv Adams
MSC Managed Care, Inc.
Florida, United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00666940
Message ID:
00666980
Views:
22
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
Previous
Reply
Map
View

Click here to load this message in the networking platform