FUNCTION FILEREADDIR( filenumber ) AS STRING
FILEREADDIR is built into version 8.30 and later.
Reads the Nth entry in the directory file
Returns the file name or an empty string if there are no more files.
dim file_number as integer dim file_name(16) as string file_number = 0 file_name = "" do file_name = filereaddir(file_number) if file_name <> "" print "file "; file_number; " is "; file_name endif file_number += 1 loop until file_name = ""