var %files 1
while (%files <= $line(@filelist,N)) {
;while %files is less then or equal to the number of lines in @filelist
did -a <Dialog Name> <Id> $nopath($line(@filelist,%files))
;add the file name to the dialog without the path in it
inc %files
;increase %files by one
}