|
Post by JackWebb on Sept 9, 2009 8:28:19 GMT -5
According to the wikki, files #dir, DefaultDir$ + "\public\*.*" count = #dir rowcount() should return all rows (including directory's) but it does not. It only returns files. The following code should not work but it does. cls files #dir, DefaultDir$ + "\public\*" count = #dir rowcount() for i = 1 to count #dir nextFile$() if #dir isdir() then fname$ = #dir name$() print fname$ end if next i end
I have not determined if the bug is in FILES or rowcount() but I suspect FILES simply because that makes more sense. Jack
|
|
|
Post by votan on Sept 9, 2009 9:17:12 GMT -5
Not sure what you are doing, but for me the wiki methode works just fine and shows all files and folders.... And your program works just as expected..
|
|
|
Post by JackWebb on Sept 10, 2009 5:00:07 GMT -5
Yes it works, but I would expect it to throw an error at the very end of line 2. By the way, the sample code from the wikki does not return all rows..
|
|
|
Post by StefanPendl on Sept 10, 2009 10:31:09 GMT -5
What error do you expect and why? *.* ... is used to list all files in a folder, since only files have extensions (empty or not) * ..... is used to list all files and folders
You may try the DOS DIR command in the command prompt and compare the results. BTW, on newer Windows versions they are the same.
|
|
|
Post by Brent on Sept 10, 2009 12:04:55 GMT -5
|
|
|
Post by JackWebb on Sept 10, 2009 22:31:04 GMT -5
So which one is it Stefan? This.. Nice work but It's actually even easier than that. rowcount() gives you the number of files in a directory. ROWCOUNT() returns the number of rows in the FILES table, which includes child folders too. A folder containing 10 files and 5 folders will result in a row count of 15. How about a folder containing 300 folders and only one file of interest, do you really need 301 array items? or this? What error do you expect and why? *.* ... is used to list all files in a folder, since only files have extensions (empty or not) * ..... is used to list all files and folders
You may try the DOS DIR command in the command prompt and compare the results. BTW, on newer Windows versions they are the same. BTW Stefan, I would LOVE to see where that is posted in the wikki that 1 star means all rows including "child folders".. runbasic.proboards.com/index.cgi?board=question&action=display&thread=1272&page=1#6786Jack
|
|
|
Post by Janet on Sept 10, 2009 22:37:26 GMT -5
Wow, does the Wiki have to define the wildcard or is it just implied? I would take *.* to mean anything that has a . in it, regardless of what's before the dot or what's after, but it has to have the dot. On the other hand, * means anything at all. I'm pretty sure the Wiki isn't going to define every standard it uses.
|
|
|
Post by JackWebb on Sept 10, 2009 23:14:33 GMT -5
Good point Janet, but if you look at the first example in the wikki under FILE it states *.* and if you look further down in the code you can see that the person who wrote it clearly intended to return directory info.
When I posted that code to you the other day it was correct for it's purpose.. I understand now that this is a windows and not a RunBASIC issue, but only after reading Brent's post. When I saw what Brent wrote months ago I understood immediately what the "problem" is...
If Stefan knew that at the time then he simply could have stated that. But instead he seems to take joy in berating people. Sorry but he sent me on a wild goose chase for nothing and trying to make me look like a fool for no reason that I can think of. If I did or said something to offend him in the past then maybe he should man up and tell me what that is.
Jack
|
|
|
Post by StefanPendl on Sept 11, 2009 3:39:12 GMT -5
I apologize for doing bad things to you, it was not my intention.
You did not offend me, as far as I can remember, but I tend to forget and forgive.
Things are changing quite fast and rules engraved in stone for a long time, have been replaced to make life easier for newbies, which includes simplifying the interpretation of wildcards.
There is too much information packed into my head and I can not always get the correct one at the correct time. I need to reset my brain to free some space, but writing documentation takes time, which I currently do not have to much of.
Hope you will still enjoy coding in RB.
|
|
|
Post by mackrackit on Sept 11, 2009 7:00:56 GMT -5
So Stefan made a mistake... Who cares? As much help as he gives I think he should be thanked for his time given.
Keep RB'en an let's have fun here.
|
|
|
Post by Carl Gundel - admin on Sept 11, 2009 7:12:12 GMT -5
I'm sorry to see people's feelings get hurt, but I don't think it was deliberate.
Stefan is so helpful, that half of the traffic on this board (and most of the traffic on the Internet) would disappear if he stopped posting!
-Carl
|
|
|
Post by JackWebb on Sept 11, 2009 11:26:12 GMT -5
Stefan,
Maybe you need a vacation to reset that quite sizeable brain of yours. If you are ever in the Tampa Florida area look me up, I'm buying the beer!
Jack
|
|
|
Post by StefanPendl on Sept 12, 2009 3:48:32 GMT -5
I don't think that the Internet will turn silent, if I am away, nor will any of the boards get silent either. I know that, because I had to work my way through a bunch of posts after my two week vacation.
I already had my yearly vacation as mentioned above, but there is to much going on at work, so I can not spend more of my ~500 hours of old vacation, I have on stock.
I will think about my replies more and if there is some information missing in the future, no more hurrying.
|
|