All MFSes should be coded in the SYSPROG application and stored in the SYSPROCS table.
An MFS is called from BASIC+ with seven arguments. As with any BASIC+ subroutine, the arguments can be named at the programmer's discretion within the MFS code. The convention used in this chapter, however, uses the following names for the seven arguments:
SUBROUTINE MY_MFS(CODE, BFS, HANDLE, NAME, FMC, RECORD, STATUS)
MY_MFS is the name of the MFS. You can create as many MFSes as you want simply by creating new subroutines (called CUSTOM_MFS, NEW_MFS, etc.) in SYSPROCS.
The value of the arguments is dependent on what function (open, read, write, etc.) has been called. Details about the values passed and the return values expected appear in the section "MFS Operations Reference" later in this chapter.
The following list, however, provides general overview of the function of each argument:
Argument | Function |
---|---|
CODE | An integer value indicating the operation to be performed (1 = read a record, 4 = delete a record, 11 = open a file, etc.). |
BFS | The list of MFSs and the BFS name for the current file or volume. This is a subvalue mark-delimited array, with the current MFS name as the first value in the array, and the BFS name as the last value. |
HANDLE | The file handle of the file or media map being accessed. |
NAME | The name (key) of the record or file being accessed. |
FMC | (various functions). |
RECORD | The entire record (for record-oriented functions) or a newly-created handle (for "get handle" functions). |
STATUS | A return code indicating the success or failure of an operation. |