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')
>
>
>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