Posts: 43
Threads: 3
Joined: Apr 2022
Reputation:
19
On startup a QB64 program implicitly does a CHDIR directory_of_exe$, so unless you do another CHDIR the full path to the exe's directory is just _CWD$. As far as I know the exe name will have to come from COMMAND$(0) as you indicated.
Posts: 176
Threads: 15
Joined: Apr 2022
Reputation:
25
(07-17-2025, 01:04 PM)luke Wrote: On startup a QB64 program implicitly does a CHDIR directory_of_exe$
I really hope not

Most of my qb64 developed utilities are in D:\Utl which is in the PATH
I can theen use that utility from any directory where I want something to be done
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience
Posts: 43
Threads: 3
Joined: Apr 2022
Reputation:
19
If you want to preserve the working directory from when the user started the program, you should do a CHDIR _STARTDIR$ at the top of your program.
Posts: 1,215
Threads: 162
Joined: Apr 2022
Reputation:
34
If not DIR_OF_EXE, then what should the default directory be?
Posts: 188
Threads: 14
Joined: May 2024
Reputation:
20
we should all be happy. we are using a different programming system. from the powers-that-be that create gtk applications for linux.
i have to suck it up. after i fire up gimp or such other program. the first time i ask for an open file dialog. to load in a document. the system assumes the user's documents directory. but it is seldom like that. more often it's expected from programs written with qt. instead this "recent" file listing. i really would like that destroyed by fire. or just edited away forever from source code. it never lists at least one document i have read or changed with the same exact application!
however what qb64 does. is no good when programs for unix and descendants. are completely expected to be aligned in one directory. actually applications in /usr/bin and vital operating system programs in /usr/sbin. the data files are stored in a yet different place. settings in another place still. if there's any help documentation. that's put in /usr/share/man or other similar place.
that is the biggest barrier. to writing a program that assumes everything is in the "current" directory.