12-04-2022, 10:36 PM
_CWD$ is the current working directory. Say you start in D:\QB64, then CHDIR to D:\QB64\Files... _CWD$ at this point would tell you D:\QB64\Files.
_STARTDIR$ tells you the directory that you started QB64 from. Let's say you're in Drive "C:\", and you start QB64 in "D:\QB64\qb64pe.exe". _STARTDIR$ will report "C:\" to you, as that's the directory you called QB64 from.
Neither of these commands are guaranteed to tell you where your compiled program itself is located. COMMAND$(0), is the best place to look for that information, as you've noticed.
_STARTDIR$ tells you the directory that you started QB64 from. Let's say you're in Drive "C:\", and you start QB64 in "D:\QB64\qb64pe.exe". _STARTDIR$ will report "C:\" to you, as that's the directory you called QB64 from.
Neither of these commands are guaranteed to tell you where your compiled program itself is located. COMMAND$(0), is the best place to look for that information, as you've noticed.