Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How search how many files is in dir

Author
Message
matti3
13
Years of Service
User Offline
Joined: 15th Nov 2012
Location:
Posted: 9th Jul 2013 19:41
So subject tells all. How i can search how many .dat files is in some directory?

Project "factory"
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 9th Jul 2013 20:17
Hi matti3

Try this piece of code....you can serach for differents files just changing the extention



I'm not a grumpy grandpa
ShellfishGames
13
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 9th Jul 2013 20:31
I'd use lower$/upper$ though to make sure the file extension check is not case sensitive.



Also, can anybody tell me whether the find first/find next approach has any advantages over checklists? Just out of curiosity, I usually use perform checklist for files etc. when investigating directories.

matti3
13
Years of Service
User Offline
Joined: 15th Nov 2012
Location:
Posted: 9th Jul 2013 20:32
Thankyou. Working.

I have one think what i don't know. If that folder is in "data/save/company/" how i can try found over there?

Project "factory"
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 9th Jul 2013 20:57
This works too.



I'm not a grumpy grandpa
ShellfishGames
13
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 9th Jul 2013 22:21
@matti3




@chafari

Indeed, however in the improbable but still possible case that the file is named ".bMP" or ".BmP" or whatever, it doesn't work anymore. You never know what the user might do... maybe he likes mixed case file extensions.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 10th Jul 2013 00:19 Edited at: 10th Jul 2013 00:29
@ShellfishGames


I'm pretty sure that people will type bmP or BmP or BMp or bmP or bMP or err I'm gonna be late

cheers.

I'm not a grumpy grandpa

Login to post a reply

Server time is: 2026-07-07 02:39:37
Your offset time is: 2026-07-07 02:39:37