Path: utzoo!utgpu!water!watmath!clyde!bellcore!tness7!petro!swrinde!ut-sally!im4u!tut.cis.ohio-state.edu!mailrus!ames!amdahl!dlb!ardent!rap From: rap@ardent.UUCP (Rob Peck) Newsgroups: comp.sys.amiga.tech Subject: Re: Execute? Yes but! Summary: wrong function to use, perhaps someone else has an alternative Keywords: Execute a program from your program without problems? Message-ID: <344@ardent.UUCP> Date: 8 Apr 88 22:44:16 GMT References: <1779@sugar.UUCP> Organization: Dana Computer, Inc., Sunnyvale, CA Lines: 28 In article <1779@sugar.UUCP>, schaub@sugar.UUCP (Markus Schaub) writes: > > My first idea: use Dos.Execute. This works except that I cannot get the > return value of the compiler. If the compilation fails, Execute writes > a nice message "m2c aborted with error 20" or similar. Execute however > returns that the execution was successful. > What am I doing wrong? What is Execute doing wrong? Execute only works if > the program was started from CLI? (Just another problem, or is it a BUG?) I had discussed this problem with Tim King just before 1.1 came out - it seems that: success = Execute("programname",0,0); returns the status of "was I able to spawn another process or not". I had requested that Execute be made to respond to the return status of the program itself, but as I recall, Execute operates in an async mode, so when it calculates the success value, it is disconnected from what is happening to the program that it spawned. I think the result is just like saying RUN programname from the CLI... like there is no place for the return result to go and the async nature of the beast makes this impossible. There are make programs for both Lattice and Manx C, on FISH disks - I have not checked how they handle this, but I suspect it is not via the Execute() function. Rob Peck ...ihnp4!hplabs!ardent!rap