Hello Code eater!
I have written something like this, and here is the subroutine that scans the directory:
scan_directory:
rem get a checklist
perform checklist for files
rem get length of checklist
checklist_length=checklist quantity()
rem store Items in arrays
ddir=0
dfile=0
for t=3 to checklist_length
rem store files
if file exist(current_dir$+"\"+checklist string$(t))=1 then file$(dfile)=checklist string$(t):inc dfile:goto dont_check_dir
rem store directorys
if path exist(current_dir$+"\"+checklist string$(t))=1 then dir$(ddir)=checklist string$(t):inc ddir
dont_check_dir:
next t
files=dfile
directories=ddir
return
What you do, is you check first if the current file being scanned is a file with "if file exist()". If so, then it is a file, and you have to jump over the "if path exist" so it doesn`t change to a directory.
What I am saying is, that the "if file exist()" will equal 1 if it is a file, but the "if path exist()" will also equal 1, no matter what. So, if it is not a file, then it is a directory (check it anyway with "if path exist()" to be REALLY sure...).
TheComet
Peachy, and the Chaos of the Gems
