08-22-2024, 02:16 PM
(08-22-2024, 11:55 AM)luke Wrote: Upon startup, QB64 programs implicitly execute a CHDIR to change to the directory containing the .exe file. This is so OPEN statements with paths relative to the .exe work as expected. You can show this location with the _CWD$ function.Thank you, the difference wasn't entirely clear to me, but now you've made it evident.
_STARTDIR$ returns the current working directory before the implicit CHDIR at startup. This value is controlled by whatever executed the program, so your launcher is responsible for setting this value. In a standard Windows shortcut, this is controlled by the "Start in" parameter.
You probably don't want to use _STARTDIR$, it's for specific cases like command-line utilities that need to interpret user-supplied paths consistently no matter where the .exe is located.
On the other hand, the wikis in certain areas are minimal and also in a language that is not mine.