The BFS argument (the second argument passed to the MFS) contains a list of all the MFSs and of the BFS for the file being accessed. If a Linear Hash dictionary file were indexed, for instance, the BFS argument would initially contain the full list of MFSs and the BFS name associated with the file: DICT.MFS, SI.MFS and RTP57. This list is a dynamic array (subvalue-mark-delimited) of all MFSs, with the proper BFS as the last value in the array.
To call the next file system routine, the MFS derives the name of the next MFS from this list, and then calls it using the "@variable" syntax for the BASIC+ CALL statement. Deriving the name of the next MFS is a two-step process. The MFS must first remove its own name from the list. After this is accomplished, the first element of the BFS array then contains the name of the next filing system routine, and can be extracted simply.
The full BASIC+ logic to strip the current MFS name from the list, derive the next routine name, and call the next routine looks like this:
FS = DELETE(BFS,1,1,1) ; * strip current name NEXT.FS = FS<1,1,1> ; * derive name of next routine * now call next routine. Note that all seven * arguments are passed CALL @NEXT.FS(CODE,FS,HANDLE,NAME,FMC,RECORD, STATUS)
For example, if an MFS called SAMPLE.MFS has been installed onto a Linear Hash file, the BFS argument will be passed to SAMPLE.MFS with this structure:
SAMPLE.MFS :@SVM : RTP57
When SAMPLE.MFS has finished processing, it executes the Delete() function to strip its own name from the list. The result is a one-element array containing simply the name RTP57 (the native Linear Hash filing system). The subsequent extract derives the name and passes it to the CALL statement. As a result, SAMPLE.MFS calls RTP57, passing it the seven required arguments.