; NextFile Example ; ---------------- ; Build a small folder tree owned by this example CreateDir "demo_files" CreateDir "demo_files\saves" file=WriteFile("demo_files\readme.txt") WriteLine file,"Demo file one" CloseFile file file=WriteFile("demo_files\config.txt") WriteLine file,"Demo file two" CloseFile file ; Open the folder for reading - the handle feeds NextFile$ dir=ReadDir("demo_files") Print "Listing of demo_files:" ; NextFile$ returns the next entry each call, moving forward only. ; "" means the folder is exhausted (the . and .. entries may appear too) Repeat entry$=NextFile$(dir) If entry$="" Then Exit ; FileType tells folders (2) from files (1) If FileType("demo_files\"+entry$)=2 Then Print "