Basicprogramming(.org) > General questions and discussions
Dir Walk Challenge
B+:
--- Quote from: chrisws on September 29, 2018, 01:31:37 AM ---
--- Quote from: B+ on September 24, 2018, 07:06:52 PM ---Well I finally got a useful directory walk working from SmallBASIC.
Chris has a Keyword DIRWALK but it isn't easy for me to use but I bet Chris could extract 100 x's faster than I.
--- End quote ---
When you launch SmallBASIC you are actually looking at the output from the DIRWALK command.
(SmallBASIC runs main.bas which provides the user interface)
--- End quote ---
Ah! I knew that all that extraction wasn't needed!
--- Code: ---'Dir Walk 2.bas for SmallBASIC 0.12.13 B+ 2018-09-28
FUNC sto(x)
if right(lcase(x.name), 4) = ".bas"
pathname = iff( x.depth > 0, (x.path + chr(92) + x.name), (x.path + x.name))
container << pathname
fi
sto = TRUE
END
DIRWALK "." USE sto(x)
SORT container
'check and file results
FOR i IN container DO ? i
tsave "BAS files.txt", container
--- End code ---
Same output results.
jj2007:
--- Quote from: B+ on September 26, 2018, 12:47:01 PM ---Nice to see MasmBasic in action again. Are the files coming out sorted automatically?
--- End quote ---
Hi B+,
No, GetFiles doesn't sort automatically, but SortFiles will do that, and it has quite a number of useful options.
B+:
Wow! took awhile to give birth to an answer. ;-))
My files list is coming in handy finding a SmallBASIC file that I know I have somewhere among the 1000's.
jj2007:
--- Quote from: B+ on June 22, 2019, 11:20:32 PM ---Wow! took awhile to give birth to an answer. ;-))
--- End quote ---
Apologies - I found your post by accident. I confess that I visit this forum only occasionally...
Navigation
[0] Message Index
[*] Previous page
Go to full version