DAY 033: COMMAND$
#3
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..

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
Reply


Messages In This Thread
DAY 033: COMMAND$ - by Pete - 12-13-2022, 06:48 PM
RE: DAY 033: COMMAND$ - by SMcNeill - 12-13-2022, 07:14 PM
RE: DAY 033: COMMAND$ - by Pete - 12-13-2022, 07:53 PM
RE: DAY 033: COMMAND$ - by SMcNeill - 12-13-2022, 09:12 PM
RE: DAY 033: COMMAND$ - by mnrvovrfc - 12-13-2022, 07:58 PM
RE: DAY 033: COMMAND$ - by SMcNeill - 12-13-2022, 09:26 PM
RE: DAY 033: COMMAND$ - by Dav - 12-14-2022, 01:21 AM
RE: DAY 033: COMMAND$ - by vince - 12-14-2022, 01:31 AM
RE: DAY 033: COMMAND$ - by SMcNeill - 12-14-2022, 01:43 AM
RE: DAY 033: COMMAND$ - by mnrvovrfc - 12-14-2022, 08:27 AM



Users browsing this thread: 5 Guest(s)