***** Class definition for private session define class PrivateSession as session * Previous data session ID nPriorDataSession = set('DATASESSION') * Status Bar settings cOldStatusBar = set('status bar') procedure init lparameter tnPriorDataSession *--- scoped to data session... set deleted on set century on set talk off set exclusive off set multilocks on set exact on set ansi on set near off set safety off if not empty(m.tnPriorDataSession) this.nPriorDataSession = m.tnPriorDataSession endif if type("m.goApp.oDatabaseMgr") = "O" local lcDbcName lcDbcName = m.goapp.oDatabaseMgr.GetFullyQualifiedDatabase() if !empty(m.lcDbcName) open database (m.lcDbcName) set database to (m.lcDbcName) else open database mmviscollect set database to mmviscollect endif else if vartype(m.gcDatabasePath)= "C" && The path to the database open database (m.gcDatabasePath) set database to (m.gcDatabasePath) else open database mmviscollect set database to mmviscollect endif endif endproc procedure destroy dodefault() if this.cOldStatusBar='ON' set status bar on else set status bar off endif endproc procedure release release this endproc enddefineAnd then you would create your class based on PrivateSession class and incorporate your logic into class methods.