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 Discussion / file extentions

Author
Message
Bogboy2000
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: United Kingdom
Posted: 11th Jan 2003 20:53
i'm trying to write a function which saves into an array what the file extention is of ever file within a folder



Extention = 0 being a folder
Extention = 1 being .*
Extention = 2 being .**
Extention = 3 being .***

but the above code doesn't work, it always comes up with 0 for everything

if anyone can help it would be much apriciated
Easily Confused
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 11th Jan 2003 21:29
Not sure if this function will help you.
This will either return the extension name if present, or if not then it will return an empty string.



...then (if I'm interpreting your snippet correctly) you might try this:

ext$ = GetExtension(checklist string$(File))
extension = len(ext$)

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Easily Confused
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 11th Jan 2003 21:31
...remember though, extension names can be more than 3 characters in length, *.html files for example.

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Bogboy2000
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: United Kingdom
Posted: 12th Jan 2003 13:56
no dice.

the function you gave me didn't work but problem solved!!



thanks for the help and for reminding me about how long file extentions can be

Login to post a reply

Server time is: 2024-04-25 13:26:56
Your offset time is: 2024-04-25 13:26:56