DIR command/Function wish?


Author Message
thetinkerer

Regular Member

Joined: 16/06/2011
Location: Australia
Posts: 68
Posted: 08:55am 20 Jun 2011      

It was a long time ago but the DIR command which returned a string.
You could use it like this:

result$= DIR("*.BAS")
Do

result$=DIR()
'do something
while len(result$)>0

Essentially you give the DIR a file mask the first go and then call Dir till there are no more entries.
In fact, the MM "files" command internally works in this fashion.
I was wondering if people would find this handy to have a DIR function in MMbasic that returned a string as described? This would allow you to have programs list files and keep track of them as well as do things like
FileExists = (Len(dir$("filen.ame"))>0) etc.

thetinkerer

Regular Member

Joined: 16/06/2011
Location: Australia
Posts: 68
Posted: 09:12am 20 Jun 2011      

Just one extra bit.
I know that This function is actually from VB and not from Qbasic but I just thought it may be handy and should be straight for to implement.