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: AustraliaPosts: 275 |
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 Codenquilts |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8600 |
Try using "*" not "*.*" |
||||
MikeO Senior Member Joined: 11/09/2011 Location: AustraliaPosts: 275 |
YEP That fixed it, Thank you Mike Codenquilts |
||||
MikeO Senior Member Joined: 11/09/2011 Location: AustraliaPosts: 275 |
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: AustraliaPosts: 3165 |
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. Geoff Geoff Graham - http://geoffg.net |
||||
MikeO Senior Member Joined: 11/09/2011 Location: AustraliaPosts: 275 |
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 |