709-218-7927

The Landfall Garden House

60 Canon Bayley Road

Bonavista, Newfoundland

CANADA A0C 1B0

CPRGreaves@gmail.com

Home

Christopher Greaves

(Home) Most-Recently Used (MRU) , What is Most-Recently Used? ; AutoSave and AuditSave , The Environment , Triggers , File Save Actions , File Close Actions , What About Third-Party Triggers? , Slave Functions , What about MRUse? , FileSaveAll, FileCloseAll, FileExit , The Set Of Procedures , lSaveAs , lClose , lFolderExists , lFileExists , lFileOverwrite , mFileSave , mFileSaveAs , mFileClose , FileSave , FileClose , FileSaveAs , FileSaveAll , FileCloseAll , DocumentClose , FileExit ,

FileSaveAll, FileCloseAll, FileExit

We appear to be ready to “cut some code”, at least for File Save and File Close. We have specifications for our slave functions, we have existing code to implement the MRUse table of filenames, we have specifications to implement the two basic triggers.

How might we best structure our FileSave/FileClose code to accommodate FileSaveAll, FileCloseAll and FileExit?

If FileSaveAll, FileCloseAll and FileExit make use of repeated calls to FileSave/FileClose, then any user cancel event in FileSave/FileClose must be relayed back to the code for FileSaveAll/FileCloseAll. That is, FileSave/FileClose must be available as function calls which return a result.

Thus, FileSave will be a cover macro that makes a call to a functional FileSave, and FileSaveAll will be a cover macro that makes repeated calls to a functional FileSave. The macro FileSave is thus seen as a special case of the macro FileSaveAll.

Likewise the macro FileClose is a special case of the macro FileCloseAll.

And the macro FileExit is essentially FileCloseAll followed by an Application.Quit.

In Slave Functions we saw the need for a very low-level set of procedures mSaveAs, mClose and so on.

Now we see the need for a second, higher level of procedures which carry out our logic ( File Save , File Close ), using mSaveAs and mClose, and return a result indicating at least whether the user cancelled.

Since the second-level procedures return a result, they will be functions.

Thus we need at least one more level of procedure - macros - to permit the user to initiate an action.

The Set Of Procedures

709-218-7927 CPRGreaves@gmail.com

Bonavista, Saturday, April 27, 2024 8:07 AM

Copyright © 1990-2024 Chris Greaves. All Rights Reserved.