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

Click here to load this message in the networking platform