Here's some code I've used:
// Populate the list of files that are in the selected folder
// File types to read = 0 (read/write files) + 1 (read files) + 32 (archive/modified files)
lb_valid = lb_files.DirList (ls_path_ext, 39)
IF (lb_valid) THEN
ll_count = lb_files.Totalitems ()
IF (ll_count > 0) THEN
// Get the list of filenames in the folder
FOR ll_index = 1 TO ll_count
ll_rc = lb_files.Selectitem (ll_index)
lb_valid = lb_files.DirSelect(ls_file1)
IF (NOT (lb_valid)) THEN
ls_filelist [ll_index] = ls_file1
END IF
NEXT
// Add the list of files into the appropriate structure
lstr_file.aur_filenamearray = ls_filelist
// Save the path and files selected
il_multiple_aur_idx ++
istr_aurfiles.aur_pathnames [il_multiple_aur_idx] = is_pathname
istr_aurfiles.aur_filenames [il_multiple_aur_idx] = lstr_file
ELSE
MessageBox ("No Files Found", "There are no read/write files in the selected folder ~"" + &
is_pathname + "~".", Exclamation!)
END IF // END IF of are there any read/write files in the selected folder
ELSE
MessageBox ("File Read Error", "Unable to read the files from the selected folder ~"" + &
is_pathname + "~".", Exclamation!)
END IF // END IF of populate the listbox with DIRLIST
Have Fun,
Olan