@Capehill
Quote:
From
https://wiki.amigaos.net/amiga/autodocs/dos.doc.txt dos.library/SystemTagList
RESULT
error -- 0 for success.
Depending on the mode used, the value returned can mean
different things.
SYS_Asynch,TRUE:
-1 = indicates System() failure.
0 = indicates System() success,
SYS_Asynch,FALSE:
-1 = indicates System() failure.
n = non-zero program error.
0 = indicates program success.
Since SYS_Asynch, TRUE obviously can't wait for the completion of the program/command to be executed, which is only possible with SYS_Asynch, FALSE, it can't return any error/return code of the program/command to be executed, it can only return success/failure if starting the async shell process, which should load that program/command, worked (0) or not (-1, usual reason: out of memory).
Independent of any errors which may happen in that async process, incl. failure of the async shell loading the program/command.
Just a wild guess, but maybe using SYS_Asynch,FALSE with
"run <>NIL: command"
could help and return more usable return/error codes.