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 extension function fail..

Author
Message
Mugen Wizardry
User Banned
Posted: 8th Aug 2010 17:46
What's wrong with this?

It won't return the file extension of the file.



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/
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 8th Aug 2010 18:08
It's doing exactly what you told it to do. The LEN of a string is the amount of characters in that string so if the string is "Command.exe" the LEN is 11. When you check the MID$ at the file length it's always going to return the very last character which is "e" in this case. It's better to search for the . in the string first then extract the extension based on where that . is.



Mugen Wizardry
User Banned
Posted: 8th Aug 2010 18:13
its not showing up..

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/
Zotoaster
21
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 8th Aug 2010 18:31
Are you testing it in a folder with some files? What do you see? You really need to give more details in your questions Mugen, you're acting a bit selfish (not flaming).

"everyone forgets a semi-colon sometimes." - Phaelax
Mugen Wizardry
User Banned
Posted: 8th Aug 2010 18:35
yes.

it just shows a black screen

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/
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 8th Aug 2010 18:49 Edited at: 8th Aug 2010 18:53
Quote: "it just shows a black screen"


This is a bad sign but I did get rid of your SYNC.

` Here's the code with SYNC


The other method I didn't mention is using IanMs Matrix 1 Utilities Plugin. His command SPLIT STRING works extremely well for extracting things using any divider including a period.



If you don't have it where have you been?

Get it here: http://forum.thegamecreators.com/?m=forum_view&t=85209&b=18

Mugen Wizardry
User Banned
Posted: 8th Aug 2010 18:53
this works.



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/

Login to post a reply

Server time is: 2026-07-24 20:35:53
Your offset time is: 2026-07-24 20:35:53