I'm going to try to walk through this using the https://github.com/DualBrain/QuickPakPro/ project.
The folder structure of the project is setup such that the README.md and other "high level" stuff is in the root of the folder. The majority of the source code is located in a QB64 folder (this could easily be called something like SOURCE, but I have my reason(s)).
When I have this on my machine, I typically use GitHub Desktop to jump between different projects and it contains a nice feature "Open in Visual Studio Code". Doing so, it will open the root of this project folder in VSCode and this is where (I believe) the problem roots itself.
Inside of the QB64 folder, I then find my sample that I wish to work with. I then press F5... the problem though is that there is then a difference between what the sample executing sees as the current working folder versus if I launch the compiled executable outside of VSCode. What I mean is that the compiled executable is located in the same folder as the .BAS file... this is the desired result. However, if VSCode launches the compiled executable (as part of the F5 process), the executable things the starting folder is the root of the project... not the same folder as where the executable is. If, however, I was to double click on the executable in Windows... things are working as expected.
One key point here is that I am using CHDIR _STARTDIR$ in my code to "reset" the current "working" folder used by the file functionality to be the location specified as the start folder.
In my mind, this start folder should be the location of the executable (by default), not the root of the project.
I'm going to try to walk through this using the https://github.com/DualBrain/QuickPakPro/ project.
The folder structure of the project is setup such that the README.md and other "high level" stuff is in the root of the folder. The majority of the source code is located in a QB64 folder (this could easily be called something like SOURCE, but I have my reason(s)).
When I have this on my machine, I typically use GitHub Desktop to jump between different projects and it contains a nice feature "Open in Visual Studio Code". Doing so, it will open the root of this project folder in VSCode and this is where (I believe) the problem roots itself.
Inside of the QB64 folder, I then find my sample that I wish to work with. I then press F5... the problem though is that there is then a difference between what the sample executing sees as the current working folder versus if I launch the compiled executable outside of VSCode. What I mean is that the compiled executable is located in the same folder as the .BAS file... this is the desired result. However, if VSCode launches the compiled executable (as part of the F5 process), the executable things the starting folder is the root of the project... not the same folder as where the executable is. If, however, I was to double click on the executable in Windows... things are working as expected.
One key point here is that I am using
CHDIR _STARTDIR$in my code to "reset" the current "working" folder used by the file functionality to be the location specified as the start folder.In my mind, this start folder should be the location of the executable (by default), not the root of the project.