////////////////////////////////////////////////////////////////////// // // APPEXIT.PRG // // Copyright: // Alaska Software, (c) 1998-2019. All rights reserved. // // Contents: // AppExit() Procedure is called after the last EXIT PROCEDURE // // Remarks: // The procedure executes the code to let Xbase++ application behave // like Cl*pper in closing open Databases at exit.. It is intended to // be used as a default user defined EXIT PROCEDURE // ////////////////////////////////////////////////////////////////////// PROCEDURE AppExit() LOCAL bErrorHandler :=ErrorBlock( {|e| Break(e)} ) LOCAL aWS, i /* * Protect shutdown-sequence against error recursion * in DbCommit() */ aWS := WorkSpaceList() FOR i:= 1 TO len(aWS) BEGIN SEQUENCE /* * Force all pending record updates to be committed * in the current workspace */ (aWS[i])->(DbCommit()) (aWS[i])->(DbCloseArea()) RECOVER (aWS[i])->(DbRRollback()) (aWS[i])->(DbCloseArea()) ENDSEQUENCE NEXT ErrorBlock( bErrorHandler ) RETURN