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.

Newcomers DBPro Corner / Set Dir wont take a relative path

Author
Message
Arcmage
14
Years of Service
User Offline
Joined: 20th Apr 2010
Location: Pluto
Posted: 17th Jul 2010 00:55
I am working on a media light 2d rpg (mostly text based) And using the set dir command to load data files but it wont seem to work unless I give it an absolute path eg C:/blablabla/Myfolder Instead of just /Myfolder I know my relative path is fine because I use it all over the code for loading datafiles without any trouble.


Here is one of the parts of the code thats has the Set Dirs in it (the other functions that have dirs are pretty much identical they just load different types of data files)


And If it helps here is the rest of the code


Btw you wont be able to compile the code as is do to the absolute paths! (unless your computer is formated exactly like mine) Media is attached

Any insights into my problem would be appreciated

Attachments

Login to view attachments
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Jul 2010 14:43
Why do you need to use set dir?

Rawwrr. Sig Fail.
Newcastle is awesome
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Jul 2010 15:05
'/Myfolder' is NOT a relative path - relative paths do not start with a slash.

If that was just a typo that you've made, then there's one other thing to consider - When you are in 'C:\Documents and Settings\William\Desktop\Data\Dark Basic Files\D&D\Spells\HSpells', then the relative path to 'Monsters' is not 'Monsters', it is '..\..\Monsters', but only from that location.

There are commands in my plug-ins that you may find help with changing directories, but it appears that I've neglected to document them - I'll have this ready by the next release.

Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Jul 2010 18:27
Quote: "There are commands in my plug-ins that you may find help with changing directories"


Damn, if i'd known that a week ago.

Rawwrr. Sig Fail.
Newcastle is awesome
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 18th Jul 2010 00:26
I would put the directory into my main folder and simply use cd "foldername", and cd ".." to return.

http://s6.bitefight.org/c.php?uid=103081

Login to post a reply

Server time is: 2024-09-28 20:22:51
Your offset time is: 2024-09-28 20:22:51