Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Exit Code to Non Aspect Parent Script 1

Status
Not open for further replies.

BobWaterhouse

Programmer
Dec 11, 2002
27
US
I am currently launching a ProComm (v4.8) Aspect script from the command line, however, a non-Procomm script will be calling it once it is automated. In order to close the screen at the end of the Aspect script, I need to use the PWEXIT command, however, it does not allow me to pass a return (or exit) code to the process calling it. Any help would be greatly appreciated.
 
I'm not aware of a way to get a return code from a script outside of Procomm, but here are a couple ideas. If the non-Procomm script supports DDE, then you could use DDE to retrieve a return value from Procomm. Another possibility would be writing the value to a temp file that the non-Procomm script could then read.

One other possible method would be to have your non-Procomm script call a new ASPECT script that then runs your main script via the execute command. Your main script would then use the exit command with a return code instead of pwexit, which would allow the new Procomm script to receive the exit code of the main script via the $EXITCODE system variable. Your new script could then use DDE to transfer that value back to the non-Procomm script, write the value to a text file, etc.

Another idea I just thought of was using the putenv command to write the exit code to a DOS environment variable that the non-Procomm script could hopefully access. However, I have seen problems with this command on Win98 (and presumably Win95 and ME), so it may not work in your environment. aspect@aspectscripting.com
 
Thank you very much for your input knob. I was coding my "temp" exit status files just before I read this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top