Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
In lieu of SESSION object for use in VFP6 based objects
Message
From
11/04/2004 13:40:36
 
 
To
10/04/2004 15:49:01
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00893854
Message ID:
00893922
Views:
10

.....

1. create a session class based on container
2. the same class would have a form (Visual FoxPro base class) added to it during init or load
3. this form should have a private data session
4. once the form is instantiated, its datasessionid could be retrieved and saved into a propery of the session object
5. the form could now be released in memory
6. the business object can then use the datasessionid used by the form


will this work? just looking at it this way makes me feel that this is too much memory and resources consumed just to get that datasessionid....


On VFP6 you can use a session object for build a private datasessionid, and bind it to a object.
public y
y =createobject("myContainer")
Y.Click
* now when VFP exec code on y, the datasession is private
*RELEASE y  && this release the y container, and then release the private datasession

DEFINE CLASS myContainer AS container
  
  	PROCEDURE Init
		WITH CREATEOBJECT('Session')			&& this build the datasession
			SET DATASESSION TO .DatasessionId	&& this bind the datasession
		ENDWITH						&& datasession costructor can to be releases
  	ENDPROC

	PROCEDURE Click
		CREATE CURSOR privateCursor ( aa i)
		? SET("Datasession"),ALIAS() 	
	ENDPROC
ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform