Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:51 05 Dec 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : DIR command/Function wish?

Author Message
thetinkerer

Regular Member

Joined: 16/06/2011
Location: Australia
Posts: 68
Posted: 08:55am 20 Jun 2011
Copy link to clipboard 
Print this post

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
Copy link to clipboard 
Print this post

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.

 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024