***** Class definition for private session DEFINE CLASS PrivateSession AS SESSION * Previous data session ID nPriorDataSession = SET('DATASESSION') * Status Bar settings cOldStatusBar = SET('status bar') * ON Error settings cOnError = ON('error') * ON Escape settings cOnEscape = ON('escape') PROCEDURE INIT LPARAMETER tnPriorDataSession *--- scoped to data session... ** Set all usual DE settings such as SET TALK, SET EXCLUSIVE, etc., preferably by using special settings class. IF NOT EMPTY(m.tnPriorDataSession) THIS.nPriorDataSession = m.tnPriorDataSession ENDIF ENDPROC PROCEDURE DESTROY DODEFAULT() IF THIS.cOldStatusBar='ON' SET STATUS BAR ON ELSE SET STATUS BAR OFF ENDIF LOCAL lcOnEscape, lcOnError lcOnEscape = THIS.cOnEscape lcOnError = THIS.cOnError ON ESCAPE &lcOnEscape ON ERROR &lcOnError LOCAL ARRAY laSessions[1] =ASESSIONS(laSessions) IF ASCAN(laSessions, THIS.nPriorDataSession) > 0 && Make sure that the session still exists SET DATASESSION TO (THIS.nPriorDataSession) ENDIF ENDPROC PROCEDURE RELEASE RELEASE THIS ENDPROC ENDDEFINE