Ian, I tried for a long time to figure out a way to do this entirely from within UD. Couldn't figure it out. I hit two walls. First, the exit code that nix receives is the status of the udt command. If you're program runs at all, you get a '0'. The second wall was when I tried setting an environment variable from within my code. The issue there is that shelling out starts a new shell that is closed as soon as you return to UD. The only way I could make it work was to echo a status code to an ascii file.
I ended up using a shell script to call my UniBasic program and pass in a location and name of an ascii file. The program determines exit status and echoes it to the ascii file. After the program completes, the shell script checks the contents of the ascii file and does an 'exit #'. I've had this working for a couple years with no issues. I'd be willing to discuss details off-list if you like. Brad > > I'm trying to write some Universe programs that plug into an > existing perl framework. For this to work these programs need to set > the standard unix exit code to different values when these programs > terminate. This will allow this framework to test for different > error conditions. (The equivalent test in a ksh script would be on > $?). What is the best way to make this work? Everthing I've tried returns 0. U.S. BANCORP made the following annotations --------------------------------------------------------------------- Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation. --------------------------------------------------------------------- ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
