Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!batcomputer!riley From: riley@batcomputer.tn.cornell.edu (Daniel S. Riley) Newsgroups: comp.sys.amiga.tech Subject: Re: Execute -- What does it always return -1? Message-ID: <9721@batcomputer.tn.cornell.edu> Date: 14 Feb 90 03:45:43 GMT References: <541@qusunb.queensu.CA> <13920044@hpfelg.HP.COM> <131688@sun.Eng.Sun.COM> Reply-To: riley@tcgould.tn.cornell.edu (Daniel S. Riley) Organization: Cornell Theory Center, Cornell University, Ithaca NY Lines: 21 In article <131688@sun.Eng.Sun.COM> cmcmanis@sun.UUCP (Chuck McManis) writes: >"Execute() returns TRUE if the program that was passed was EXECUTED." > >It doesn't say anything about return values of the executed function >because it doesn't care about that. Starting with 1.2, I believe IoErr() will return pr_Result2 from the program that was executed (pr_Result2 returns the AmigaDOS error code, like 214 == "disk write-protected"). This is not the same as the return code from the program, so "exit(25)" in a C program will show up as a 0 return value from IoErr()--you have to explicitly set pr_Result2 to a value to use this from C. If you are running WShell with Bill Hawes' patches to Execute(), then you get more useful information, but that's obviously non-standard. (This is based on a vague recollection of something Andy Finkel said on BIX long ago and far away. I'd check it, but I have Bill Hawes' patch installed...) -Dan Riley (riley@tcgould.tn.cornell.edu, cornell!batcomputer!riley) -Wilson Lab, Cornell University