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 / BBB GUI question, OpenFileDialog'

Author
Message
BlackChaos
16
Years of Service
User Offline
Joined: 2nd May 2010
Location: London
Posted: 8th Dec 2012 13:34
Is it possible to get this command to return a more relative path?
E.g. "/Models/Wing.dbo" rather than "C:/Desktop/..../Models/Wing.dbo"




Thanks

AEngine 2012 Ameadus Project Feedback or Food o0
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 8th Dec 2012 14:19 Edited at: 8th Dec 2012 14:19
You could just manipulate the data yourself using string modification functions...

I use STYX to do this for me...

So I cannot really give much help there... aside from sharing my experience and point

Try Matric1Utils, it should have string handling features for you

Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 8th Dec 2012 15:37
Quote: "Is it possible to get this command to return a more relative path?"

i don't think so and there's no point in doing that.
It's easy to retrieve the part of the path you want.

Just start at the end and count the number of slashes. If you just want file name end at first slash you encounter, if you want first folder name end at second slash you encounter etc.

something like this (i haven't tested this code so be warned):


Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Dec 2012 15:38 Edited at: 8th Dec 2012 15:39
The STYX functions should work; but I've had trouble the STYX filename functions to work recently.

A solution I use is to remove the application path from the file path, if it is a sub-directory of the application path.

With Matrix1, in simplistic form, it can be written like this:


If you do not have Matrix1 installed, you should install it.

Edit: Brandon posted just before I posted my reply.

BlackChaos
16
Years of Service
User Offline
Joined: 2nd May 2010
Location: London
Posted: 8th Dec 2012 15:52
Thanks peeps

This helped

AEngine 2012 Ameadus Project Feedback or Food o0

Login to post a reply

Server time is: 2026-07-08 03:46:55
Your offset time is: 2026-07-08 03:46:55