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 / file requester - get file's name + folder + extension?

Author
Message
Mugen Wizardry
User Banned
Posted: 16th May 2010 23:47
can someone make functions that gets JUST the file's name, folder, and extension like this?

c:\my3dmodel.3ds would be "my3dmodel"
".3ds" would be the extension
"c:\" would be the folder



thanks!

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 17th May 2010 00:48
Quote: "can someone make functions that gets JUST the file's name, folder, and extension like this?"

Yes! You can!!

All you need to do is look through the string "file$" (I would suggest starting at the end of the string and working back until you find a baxslash or a forwardslash. Then seperate the string either way...

Since I'm feeling generous:


...both of these functions are untested and the product of a very tired and half drunk developer so please use them wisely!!

Mugen Wizardry
User Banned
Posted: 17th May 2010 01:02
folder name returned the entire folder minus the "g"

after "jpg"

and file name returned the name of the file plus 1 extra "g" after "jpg"

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 17th May 2010 01:58
Shucks, maybe you should study my dodgy code and learn from it... I just worked out where I went wrong and I'm more drunk than when I wrote it!!!

TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 17th May 2010 03:06

Login to post a reply

Server time is: 2026-07-25 11:48:57
Your offset time is: 2026-07-25 11:48:57