I am trying to code a little file selection menu for a project I am making.
I thought it would be possible to show files and directories using the FFIRST function (followed by FNEXT). But I only get the file names. No directories (even when playing around with reg b values).
Is there a catch with this function?
Parameters: C = 40H (_FFIRST)
DE = Drive/path/file ASCIIZ string
or fileinfo block pointer
HL = filename ASCIIZ string (only if
DE = fileinfo pointer)
B = Search attributes
IX = Pointer to new fileinfo block
Results: A = Error
(IX) = Filled in with matching entry
and here is the (quick and dirty) code:
;--- Display the working directory
ld de,disk_workdir
ld hl,(80*6)+16
call draw_label
;--- Display offset for the filename(s)
ld hl,(80*7)+16
push hl
;--- First time use FFIRST
ld c,_FFIRST
ld b,16+1+2+4
ld de,disk_workdir
ld ix,disk_fib
call DOS
_fd_loop:
;--- Check for errors
and a
jp nz,_fd_error
;--- Display the filename or directory
pop hl
ld bc,80
add hl,bc
push hl
ld de,disk_fib+1
call draw_label
;--- Get other files and or directories
ld c,_FNEXT
call DOS
; --- Loop
jp _fd_loop
;--- An error was found (probably 0xd7)
_fd_error:
pop hl
ret
The 'disk_workdir' has the value "B:\",0
Any help/hint is appreciated
Entrar ou registrar-se para comentar

