*Capture Current Environment settings PRIVATE msafety msafety=SET('safety') SET SAFETY OFF PRIVATE myalias myalias='' myalias=ALIAS() PRIVATE mrecno mrecno=0 IF !EMPTY(myalias) store RECNO() TO mrecno ENDIF PRIVATE mviewfile mviewfile=hdir+sys(3) CREATE VIEW &mviewfile *HERE I close tables, open new tables, set relationships, etc for temporary *stuff will need to get back to original environment *Restore original environment settings SET VIEW TO &mviewfile IF FILE(mviewfile+'.vue') DELETE FILE (hdir+mviewfile+'.vue') ENDIF IF !EMPTY(myalias) SELECT(myalias) ENDIF IF mrecno>0 GOTO mrecno ENDIF SET SAFETY &msafety