home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18119 < prev    next >
Encoding:
Text File  |  1993-01-04  |  1.5 KB  |  64 lines

  1. Path: sparky!uunet!math.fu-berlin.de!uni-paderborn.de!not-for-mail
  2. From: tron@wembley.uni-paderborn.de (Matthias Scheler)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Problems with dos.library/RunCommand() and "C:Execute"
  5. Date: 4 Jan 1993 21:33:54 +0100
  6. Organization: Universitaet Paderborn, Germany
  7. Lines: 53
  8. Message-ID: <1ia6viINN75l@wembley.uni-paderborn.de>
  9. NNTP-Posting-Host: wembley.uni-paderborn.de
  10.  
  11.     Hi,
  12.  
  13. the following peace of code doesn't work and I don't know why. After "Execute"
  14. has been called with "RunCommand()" stdio doesn't work on stdout anymore. A
  15. "Please insert volume Result:" requester appears while the "PrintF()" is
  16. executed. I use 39.106 and 39.29 on an A4000, but it doesn't work with OS 2.x,
  17. too.
  18.  
  19. #include <dos/dos.h>
  20. #include <dos/stdio.h>
  21. #include <clib/dos_protos.h>
  22.  
  23. #include <stdlib.h>
  24. #include <stdio.h>
  25. #include <string.h>
  26.  
  27. char *Cmd = "S:PCD RAM:\n";
  28.  
  29. /* This PrintF() works FINE, it is NOT the reason for the problem. */
  30.  
  31. void __stdargs PrintF(char *Fmt,...)
  32.  
  33. {
  34.  (void)VPrintf(Fmt,(LONG *)&Fmt+1L);
  35.  Flush (Output());
  36. }
  37.  
  38. void main(void)
  39.  
  40. {
  41.  BPTR SegList;
  42.  LONG Result;
  43.  
  44.  if ((SegList=LoadSeg("C:Execute"))==NULL)
  45.   {
  46.    PrintF ("No Execute\n");
  47.    exit (10);
  48.   }
  49.  
  50.  Result=42L;
  51.  PrintF ("Result: %d\n",Result);
  52.  
  53.  (void)SetProgramName("Execute");
  54.  Result=RunCommand(SegList,4000L,Cmd,strlen(Cmd));
  55.  PrintF ("Result: %d\n",Result);
  56.  
  57.  UnLoadSeg (SegList);
  58.  
  59.  exit (0);
  60. }
  61. -- 
  62. Matthias Scheler                                         tron@uni-paderborn.de
  63. University of Paderborn (Germany)
  64.