>> on shutdown >> endif >>endif >>
procedure CleanUp local loError, i, j IF VARTYPE(m.oAppObj) = 'O' oAppObj.write_log('Entering ...' ,program(),'1') endif on shutdown ON ERROR if vartype(oAppObj) <> 'O' quit endif TRY FOR lnI = _screen.Forms.Count TO 1 STEP - 1 oAppObj.write_log('Releasing form ' + _screen.Forms[m.lnI].name,program(),'2') _screen.Forms[m.lnI].Release() NEXT if !empty(oAppObj.SQLHandle) &&release your connection(s)... sqldisconnect(0) endif close databases all SET DATABASE TO if vartype(oAppObj) = 'O' if file(oAppObj.cImagesDBC +".DBC") delete database (oAppObj.cImagesDBC) endif endif catch to loError oAppObj.write_log('Error occurred in the CleanUp procedure: ' + loError.message,program(),'1') endtry local lcFileName local array laRV[1] try i = adir(laRV,"RVC_"+'*.*') if i > 0 for j = 1 to i lcFileName = laRV(j, 1) delete file (lcFileName) endfor endif catch to loError oAppObj.write_log('Error occurred in the CleanUp procedure: ' + loError.message,program(),'1') endtry _screen.controlbox = .t. if oAppObj.lDevMode wait window 'Shutting Down In Dev Mode...' timeout .5 if wexist('standard') show window 'standard' endif set status bar on set help to &&can't set help to without foxhelp.hlp try do quit_prog clear all close all release all catch to loError IF VARTYPE(oAppObj) = 'O' oAppObj.write_log('Error occurred in the CleanUp procedure: ' + loError.message,program(),'1') endif endtry return endif if program()=program(1) &¬ under helperw try clear all close all release all catch to loError IF VARTYPE(oAppObj) = 'O' oAppObj.write_log('Error occurred in the CleanUp procedure: ' + loError.message,program(),'1') endif endtry endif CLEAR EVENTS return