12-13-2022, 07:53 PM
Nice catch!
I just tried this...
Made a routine with COMMAND$() and saved it as untitled.exe
Opened another instance of the IDE: RUN "untitled.exe"
It only showed the "untitled.exe" program name returned for COMMAND$(0).
So I then typed the full drive and path... RUN "C:\QB64PE\untitled.exe"
And it returned "C:\QB64PE\untitled.exe"
So it's the calling info it's collecting, rather than the actual drive and path of the app passing the arguments. That's needed for building any project that would not provide the full drive and path info.
So a more bullet proof method would be to pass the drive and path with _CWD$, something like..
It needs to be a bit more involved. Add a space to pass it with other info, etc., but working with it should insure the correct drive and path from the calling program.
So I checked the first snippet and also found COMMAND$(0) include its own drive and path when it is run from the QB64 IDE, but when it RUNs itself, it only includes the program name.
I will make some edits accordingly in my original post for this, thanks!
Looks like #2 was the right choice in that app, today.
Pete
I just tried this...
Made a routine with COMMAND$() and saved it as untitled.exe
Opened another instance of the IDE: RUN "untitled.exe"
It only showed the "untitled.exe" program name returned for COMMAND$(0).
So I then typed the full drive and path... RUN "C:\QB64PE\untitled.exe"
And it returned "C:\QB64PE\untitled.exe"
So it's the calling info it's collecting, rather than the actual drive and path of the app passing the arguments. That's needed for building any project that would not provide the full drive and path info.
So a more bullet proof method would be to pass the drive and path with _CWD$, something like..
Code: (Select All)
RUN "untitled.exe " + _CWD$
It needs to be a bit more involved. Add a space to pass it with other info, etc., but working with it should insure the correct drive and path from the calling program.
So I checked the first snippet and also found COMMAND$(0) include its own drive and path when it is run from the QB64 IDE, but when it RUNs itself, it only includes the program name.
I will make some edits accordingly in my original post for this, thanks!
Looks like #2 was the right choice in that app, today.
Pete