Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 05:45 09 May 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$ on 5.0404

Author Message
MikeO
Senior Member

Joined: 11/09/2011
Location: Australia
Posts: 275
Posted: 07:54pm 06 Aug 2017
Copy link to clipboard 
Print this post

Hi can anyone confirm, it looks like the DIR parameter for the folder listing on DIR$ is broken on ver 5.0404.

If i run the following I get nothing when there are folders.

f$ = DIR$("*.*", DIR)
DO WHILE f$ <> ""
PRINT f$
f$ = DIR$()
LOOP

with Files command or with DIR$("*.*", FILE) in the above code it OK.


>Files
A:/
<DIR> 070817
<DIR> mike
100015 empty.txt
10 espnode.dat
4061 flowcode.txt
3 lingcode.txt
100015 logfile.txt
0 New Text Document.txt
12928 TEMP.BAS
0 TEST10.TXT
0 TEST11.TXT
0 TEST12.TXT
0 TEST3.TXT
0 TEST5.TXT
0 TEST7.TXT
0 TEST9.TXT
16 wifiname.dat
10 wifipass.dat
2 directories, 16 files

Running the Code

TEST12.TXT
TEST10.TXT
empty.txt
logfile.txt
TEST11.TXT
TEST7.TXT
TEST9.TXT
TEST5.TXT
TEST3.TXT
TEMP.BAS
lingcode.txt
flowcode.txt
New Text Document.txt
wifiname.dat
wifipass.dat
espnode.dat

I need this function unfortunately
Edited by MikeO 2017-08-08
Codenquilts
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8600
Posted: 08:44pm 06 Aug 2017
Copy link to clipboard 
Print this post

Try using "*" not "*.*"
 
MikeO
Senior Member

Joined: 11/09/2011
Location: Australia
Posts: 275
Posted: 11:02pm 06 Aug 2017
Copy link to clipboard 
Print this post


YEP That fixed it, Thank you Mike
Codenquilts
 
MikeO
Senior Member

Joined: 11/09/2011
Location: Australia
Posts: 275
Posted: 12:46am 07 Aug 2017
Copy link to clipboard 
Print this post


Geoff, Peter, just a thought, if this is going to be a permanent change the documentation will need changing to reflect the new "wildcard" format.

Mike
Codenquilts
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 04:49am 07 Aug 2017
Copy link to clipboard 
Print this post

This is not a "change" or a "new format". The command is doing what it should.

With *.* you are specifying two wildcards with a period in the middle. Your directory names did not have an embedded period so they did not match the search pattern.

I agree that DIR$("*.*", FILE) returning all files/directories is inconsistent and confusing. Perhaps the manual entry should go into more detail regarding wildcards.

GeoffEdited by Geoffg 2017-08-08
Geoff Graham - http://geoffg.net
 
MikeO
Senior Member

Joined: 11/09/2011
Location: Australia
Posts: 275
Posted: 12:01pm 07 Aug 2017
Copy link to clipboard 
Print this post

Thanks for the clarification Geoff you are correct regarding a directory listing not normally having a period. I was caught a little as this was part of an old program and on previous versions of mmbasic had always worked.

Mike
Codenquilts
 
Print this page


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

© JAQ Software 2024