An MFS is called once for each file operation (note that one BASIC+ call or routine called from the System Monitor may translate into several MFS calls). Each file operation typically requires separate logic within the MFS. For example, an MFS will usually execute different logic for a read and a write operation.

The first argument passed to the MFS (the CODE argument) contains an integer value that indicates the operation that has been requested. For example, if the operation is "read a record," CODE will contain the value 1. If the operation is "delete a file," CODE will contain the value 15, and so forth.

Standard constant names for the CODE argument are provided in the $INSERT record FILE.SYSTEM.ONGOSUB. These standard names are used within this chapter for clarity.

The MFS must determine what operation is being performed, and branch or "dispatch" to the appropriate logic within the MFS.

Two methods are commonly used when coding an MFS dispatch routine.  They are:

  • No labels