90h FL$WCAT file list with wildcards
A register  - 1 to start catalogue and 0 to continue. Top bit set if sizes required.
B register  - Device: 0=A:,1=B:,2=C:,3=D:
X register  - Where to put the filename (leading byte count) .
UTW_S0+1  - Length of string at UTW_S1 (if top bit is set, filetype is in UTW_S0).
UTW_S0(msb)  - File type if top bit of S0+1 is set.
UTW_S1  - Points to match string.
A register  - file type found.
B register  - 1 if OPO, 2 if OPT or 0 otherwise.
UTW_S0  - contains no of bytes in the block file or number of records in the ODB file found (only if top bit of A was set).

Provides a wild catalogue of the file names on a device.

The routine must be called first with A register non zero and thereafter with the A register 0 for each subsequent entry.

Works in the same way as FL$BCAT and FL$CATL except that it returns only those files which are consistent with the match string pointed to by UTW_S1. The match string can contain the wild card characters:

   *    match any number of any characters.
   +    match any 1 character.

It can also contain any of the following file extensions:

  • .ODB - text (database) files
  • .OPL - OPL procedures (text or object)
  • .DIA - CM/XP diary save files
  • .COM - Comms Link setup files
  • .PLN - Spreadsheet files
  • .PAG - Pager setup files
  • .NTS - Notepad files
  • .TY8-TYF - file types (88-8F)
  • .OPT - OPL procedures (text only)
  • .OPO - OPL procedures (object only)

Wild cards cannot be used in file extensions except * on its own so that "MAIN.*" will give all types of file called "MAIN".

"*.*" will give all files of all types.

If no file extension is supplied, .* will be assumed, so that "M*" will give all files of all types starting with "M".

Note that the file extension .OPL will match and file which has Text or object and .OPO and .OPT work in exactly the same way as .OPL.

If the top bit of UTW_S0+1 is set, it means that there is no extension in the filespec, but the file type to use is in UTW_S0.

Returns error 238 when there are no further directory entries which match the string supplied.

Note that only X need be passed when A is 0 to continue.

If the top bit of A is set, returns sizes in UTW_S0.

See also FL$NCAT.

This call is not available on CM/XP machines.

Example The following procedure will provide a catalog of all saved CM/XP diary files that begin with "D".
        LDAA    #1              ;A=1 first time
        LDX     #MATCH
        LDAB    0,X
        STAB    UTW_S0+1:       ;length of match string
        STX     UTW_S1:         ;Point to match string
        LDAB    #MY_DEVICE      ;which device : 0 - 3 for A: to D:
        BRA     FIRST

LOOP:   LDX     #TEMP           ;print byte string in TEMP
        PSHX                    ;pass address to UT$DISP
        OS      UT$DISP
        ASCII   "%s"            ;leading byte count string
        DB      13,10           ; CR LF
        DB      0               ;terminator for format string

        CLRA                    ;A=0 on subsequent calls to FL$WCAT
        LDX     #TEMP           ;filenames placed in TEMP by FL$WCAT
        OS      FL$WCAT
        BCC     LOOP            ;repeat until error returned
        CMPB    #238            ;eof err means normal 
        BEQ     DONE
ERROR:  ...                     ;otherwise report error

DONE:   ...

Errors 238 - No more entries (normal completion)

246 - no pack in slot
245 - bad or damaged pak in slot
243 - selected an invalid pak.
236 - Bad file name.