Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataSession troubles.
Message
From
29/12/2000 20:59:50
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00457954
Message ID:
00458026
Views:
30
Hi Doru,
I don't ever to SET DATASESSION TO because of the disruption of the controlsources in the current form, or maybe 'cause I just don't like it. I do everything IN the session, so I don't have to do switch anything. I have a special session class that I pass other classes and it instantiates them in it. My point is this: If a class is created while in a private session, it just works in that session and is completely unaffected by everything else and doesn't affect anything else. The following isn't that class, but should work for you.
DEFINE SessionBase AS Session
   oParent = .NULL.

   ***************************
   PROCEDURE Init (oParent)
      SET TALK OFF         
      IF VARTYPE(m.oParent) = "O"
         This.oParent = m.oParent
      ENDIF
      SET DELETED ON
      SET EXCLUSIVE OFF
      SET MULTILOCKS ON
      SET NOTIFY OFF
      SET SAFETY OFF
      SET EXACT OFF
      SET NULLDISPLAY TO " "
      SET CENTURY ON
      SET REPROCESS TO 1
      RETURN
   ENDPROC
ENDPROC
DEFINE Example AS SessionBase
      PROCEDURE Init(oParent)
           DODEFAULT(m.oParent)
           USE People NOUPDATE
      ENDPROC

      PROCEDURE CallMe(tcEmpno)
          LOCAL RetVal
          RetVal = ''
          IF SEEK(m.tcEmpNo, "EmpNo", "People")
              RetVal = IIF(EMPTY(TermDate),'','*') ;
                  +ALLTRIM(CallName)+' '+EmpName
          ENDIF        
      ENDPROC
      PROCEDURE Destroy
          IF USED("People")
              USE IN People
          ENDIF
      ENDPROC
ENDDEFINE

* Example
CallMeObject = NEWOBJECT("Example", "ThisPRGFile")
then
Name = CallMeObject.CallMe(EmplNo) * As needed.
when the CallMeObject goes out of scope, it's done. There no need to reset anything.
Charlie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform