(12-05-2022, 03:48 AM)DSMan195276 Wrote: I wouldn't recommend relying on `Command$(0)`, it's unreliable for this as it may have a relative path such as `./foobar/qb64pe.exe`. Stripping off the exe in that case will give you the path "./foobar", which will be treated relative to your current CWD and likely give you the wrong result since it's not absolute.
The best way to handle this would be saving the contents of `_CWD$` as soon as the program starts, since we always fill that with the location of the executable (discovered by OS-specific means other than `Command$(0)`).
If you're finding that `_CWD$` is unreliable for some reason at the start of the program then that sounds like a bug, but it really shouldn't be as it's fairly straight forward in what it does. I'd be curious to hear what behavior you're seeing where it's wrong.
OK it's possible I got confused which where I was. I have a nightmare jungle of GUI versions in a couple of places and loading files from IDE I sometimes mess up path...
I will switch back to _Cwd$ if that is the one most likely to return the full or absolute path and try and pay more attention when using _OpenFileDialog$
Thanks for the an under-the-hood tip
That slash thing still could be handy.
b = b + ...