home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18137 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  1.5 KB

  1. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!usc!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!umn.edu!csus.edu!netcom.com!netcomsv!terapin!paulk
  2. From: paulk@terapin.com (Paul Kienitz)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Error in AmigaDOS Execute() ???
  5. References: <1993Jan4.112435.29118@doug.cae.wisc.edu>
  6. Message-ID: <paulk.339k@terapin.com>
  7. Date: 4 Jan 93 17:31:13 PST
  8. Organization: BBS
  9. Lines: 22
  10.  
  11. > I have been running into a problem with AmigaDos's Execute()
  12. > function.  It returns a non-zero value even when trying to
  13. > Execute() a command that doesn't exist.  How do I get the actual
  14. > return value and how do I find out if an error occured while using
  15. > Execute().  According to the documentation, Execute() returns a
  16. > NULL if unsuccessful.
  17.  
  18. "Unsuccessful" in this context means only, unsuccessful at creating a
  19. child CLI to run the command string in.  The results of the commands
  20. themselves are lost.
  21.  
  22. If you need the return value, you can't use Execute.  You have to use
  23. RunCommand or SystemTagList or, under 1.3, one of several various
  24. hacks such as the Aztec fexec functions or (I think) the arp.library
  25. SyncRun.
  26.  
  27. Or you can try to hack up code to call the child program within your
  28. own process, but this means you have to do all your own work of finding
  29. and loading it ... but it's not impossible to write the equivalent of
  30. RunCommand under 1.3.  The trickiest part is passing the argument line to
  31. BCPL programs.  I happen to know how this is done ... (talking about
  32. wasting brain space on useless data)
  33.