PUBLIC System System = System() && Create the Object s2=CREATEOBJECT("session") && create datasession 2 set datasession to s2.datasessionid && enter into 2 ? SET("Datasession") && 2 ? System.set.dataSession() && 1 !! * and it is impossible to wrapper SET DATASESSION TO into a class ? System.set.dataSession(1) && this change the datasession of System only ? SET("Datasession") && still 2
Fabio, I appreciate your input. You are right about the scoping of the DataSession method of the class. When I put the class together, I ran a simple smoke test on it. I am embarrassed that this escaped me. I have comment out the DataSession method, and posted the updated. I am sorry for any inconvenience I may have caused you, or anyone. But, I believe the term “useless” is a bit harsh. Greg Reichert, December 21, 2005
Greg, you have not gathered the point. Every SET or SYS() that it depends on the datasession their cannot work, to work exists two solutions only: 1. to pass as parameter the current datasession and to use SET DATASESSION in all the class methods 2. the VFP developer has to create an VFPSystem object for every datasession created from the application (with an array or a collection). Example:
CLEAR PRIVATE VFPsystem VFPsystem=CREATEOBJECT("VFPsystem") WITH CREATEOBJECT("Session") SET DATASESSION TO .DatasessionId ? "Current ",SET("TALK") ? "change set TALK to ON, return ", VFPsystem.Set.TALK("ON") && Bad ? "Current ",SET("TALK") ? "current via VFPSystem ",VFPsystem.TalkSetting() && Bad ENDWITH
SET ANSI SET AUTOSAVE SET AUTOINCERROR SET BLOCKSIZE SET CARRY SET CENTURY SET COLLATE SET CONFIRM SET CURRENCY SET DATABASE SET DATE SET DECIMALS SET DELETED SET DELIMITERS SET EXACT SET EXCLUSIVE SET FIELDS SET FILTER TO SET FIXED SET HOURS SET KEY SET LOCK SET MARK TO SET MEMOWIDTH SET MULTILOCKS SET NEAR SET NULL SET POINT SET REPROCESS SET SAFETY SET SECONDS SET SEPARATOR SET SYSFORMATS SET TABLEPROMPT SET TALK SET UNIQUE SET VARCHARMAPPING SYS(7) SYS(21) SYS(22) SYS(103) SYS(2001, cSETCommand [, 1 | 2]) ....