Please make the "Current Directory" persistent per

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Please make the "Current Directory" persistent per

Post by Kaeru Gaman »

the "Current Directory" field in the Compiler Options is quite handy to help finding content in the same dir as the source, when you compile-run codes for little tests and other things.

but if you alter it once, it will be changed to that value for ALL sources, even for all new.
please make it persistant to each single source like the other compiler options.
oh... and have a nice day.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Isn't it already persistent? :?

Code: Select all

; CurrentDirectory = ..\SomeDirectory\
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

was strange... was hard to revoke it...

1. opened a "New File", in that way that a path was entered in the options field.
seems to happen when the last file closed had a manually entered path.

2. run a simple testcode, like

Code: Select all

Debug "bla"
3. switch to another tab with another code that is in another source dir.

4. run it
the path will be the one manually entered, not "empty"
leads to a "file not found" when trying to load ressources from the source dir
oh... and have a nice day.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

PS:

oh.. sorry...
perhaps it should be an error-report?
oh... and have a nice day.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

this is not a error, only a missing feature :wink:
if you don't set the currentdir, the currentdir is undefined
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

it is an error.
when I clear the field manually to have the source dir as current dir, safe the file, run the other code and then switch back, the field is not empty anymore.

I will post a recipe to perform the error later..
watching "xchange" atm...
oh... and have a nice day.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

> when I clear the field manually to have the source dir as current dir, safe the file
this safes the file in the directory, but doesn't set the currentdir for your application.
if i use your final and start it in a commandshell, it can't find any file in
application dir. so if freak set this for you, it's only for testing in IDE usefull,
but your application have to add:

Code: Select all

SetCurrentDirectory(GetPathPart(ProgramFilename()))
and your are on the sure side.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

:x when I close all tabs and open a new one, there is a PATH in the CurrentDir field!

this is not a FEATURE!

... and now stop that, I'm really getting fucking angry right now!
oh... and have a nice day.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Open Preferences/Editor/Defaults and empty the "Current directory:" line and Apply.
Should work.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

ok, sorry.

yes, it was changed in the Defaults.

... I emptied the corresponding line in the Purebasic.prefs, now it works properly.
oh... and have a nice day.
Post Reply