| 416-621-9348 cgreaves@chrisgreaves.com | |
|---|---|
| Home Services Products |
Error! Cannot open file.
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.
Loading
Toronto and Mississauga, Sunday, December 05, 2010 3:30 PM
Copyright © 1996-2010 Chris Greaves. All Rights Reserved.