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.

Author
Message
Killswitch
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: School damnit!! Let me go!! PLEASE!!!
Posted: 4th Sep 2003 21:29
I'm writing a little function to find files within a directory, I'm trying to give it a few different features (name,type,date) and im stuck on type, how does get file type() work? As it doesn't return a string value (as an example im looking for all the .txt files within a directory).

Thanks

~I'm going now, try not to sound so happy~
Evil Noodle
23
Years of Service
User Offline
Joined: 28th Apr 2003
Location:
Posted: 4th Sep 2003 21:53
file type only signals whether it is a File (0) a directory (1) or if there are no more files left to read (-1)

i guess you could use the get file name$() command and check the last three letters against a list of extensions , theres prob an easier way though knowing me
Killswitch
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: School damnit!! Let me go!! PLEASE!!!
Posted: 5th Sep 2003 00:10
I'll try checking get file name$() with mid$() so when it comes to a "." the following letters are moved to another variable which I can check... Might work

~I'm going now, try not to sound so happy~
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Sep 2003 01:14
Use RIGHT$()

TheOneRing
22
Years of Service
User Offline
Joined: 28th Aug 2003
Location: Right here.
Posted: 5th Sep 2003 01:23
Quote: "Use RIGHT$()"


...except for those few files with 4 digit extensions, eh??
cusoi
23
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: Netherlands
Posted: 5th Sep 2003 01:32
Yeah... Like .dbpro files

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Sep 2003 02:00 Edited at: 5th Sep 2003 02:00
I don't see that it matters if you are looking for .txt files, but Ok, try this instead:

Killswitch
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: School damnit!! Let me go!! PLEASE!!!
Posted: 6th Sep 2003 20:28
Thanks for helping, I'm having problems running any program with mid$() len() and other text related commands (see my other thread).

~I'm going now, try not to sound so happy~

Login to post a reply

Server time is: 2026-07-24 23:11:52
Your offset time is: 2026-07-24 23:11:52