' This routine will read the selected drive ("a:\*.*") and tell you which
' files are FOLDERS (preceeded by an asterisk) and which are regular files.
' this is a "redo" of the routine in the GFA manual with one exception,
' THIS ONE WORKS ! (the one in the manual doesn't)
search_data$="a:\*.*"        !Search template (search "A" for ALL files (*.*))
attr%=&X11111                !File attribute
'
~GEMDOS(26,L:BASEPAGE+128)   !Set the Disk Transfer Address (BASEPAGE+128)
' then search directory (a:\*.*) for file w\specific name, in this case
' *.* .  this can be changed to  a:\*.acc  to search for files ending in
' ACC...(accessories).
r%=GEMDOS(78,L:VARPTR(search_data$),attr%)   !Search current directory for
'                                             template, if found it will be
'                                             set in the DTA
REPEAT
  IF r%=0                                    !If data is available
    IF BYTE{BASEPAGE+149} AND 16             !If it's a FOLDER
      PRINT " *";CHAR{BASEPAGE+158}          !print name with asterisk
    ELSE                                     !otherwise
      PRINT 'CHAR{BASEPAGE+158}              !just print name
    ENDIF
  ENDIF
  r%=GEMDOS(79)                              !continue searching until r%=-49
UNTIL r%=-49                                 !which means no further data
'                                             available
