Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following sample program illustrates how to execute a direct call to the first MFS for a file. The example program calls the filing system with a code of 28 (RECORD.COUNT) to return the total number of records in the file.

 

Code Block
DECLARE SUBROUTINE MSG , FSMSG
EQU RECORD.COUNT$ TO 28
RESP = 'CUSTOMERS'
 
OPEN RESP TO FILE THEN
  FS.LIST = FILE<1,1>
  HANDLE = FILE<1,2>
  NEXT.FS = FS.LIST<1,1,1>
  NAME = "" ; FMC = 0 ; RECORD = "" ; STATUS = 0
  CALL @NEXT.FS(RECORD.COUNT$,FS.LIST,HANDLE,NAME,FMC,RECORD,STATUS)
  IF STATUS THEN
    MSG(@window, FMC:" record(s) counted.")
  END ELSE
    MSG(@window, "Can't count records in ":RESP)
  END
END ELSE
  FSMSG()
END