home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!math.fu-berlin.de!uni-paderborn.de!not-for-mail
- From: tron@wembley.uni-paderborn.de (Matthias Scheler)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Problems with dos.library/RunCommand() and "C:Execute"
- Date: 4 Jan 1993 21:33:54 +0100
- Organization: Universitaet Paderborn, Germany
- Lines: 53
- Message-ID: <1ia6viINN75l@wembley.uni-paderborn.de>
- NNTP-Posting-Host: wembley.uni-paderborn.de
-
- Hi,
-
- the following peace of code doesn't work and I don't know why. After "Execute"
- has been called with "RunCommand()" stdio doesn't work on stdout anymore. A
- "Please insert volume Result:" requester appears while the "PrintF()" is
- executed. I use 39.106 and 39.29 on an A4000, but it doesn't work with OS 2.x,
- too.
-
- #include <dos/dos.h>
- #include <dos/stdio.h>
- #include <clib/dos_protos.h>
-
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
-
- char *Cmd = "S:PCD RAM:\n";
-
- /* This PrintF() works FINE, it is NOT the reason for the problem. */
-
- void __stdargs PrintF(char *Fmt,...)
-
- {
- (void)VPrintf(Fmt,(LONG *)&Fmt+1L);
- Flush (Output());
- }
-
- void main(void)
-
- {
- BPTR SegList;
- LONG Result;
-
- if ((SegList=LoadSeg("C:Execute"))==NULL)
- {
- PrintF ("No Execute\n");
- exit (10);
- }
-
- Result=42L;
- PrintF ("Result: %d\n",Result);
-
- (void)SetProgramName("Execute");
- Result=RunCommand(SegList,4000L,Cmd,strlen(Cmd));
- PrintF ("Result: %d\n",Result);
-
- UnLoadSeg (SegList);
-
- exit (0);
- }
- --
- Matthias Scheler tron@uni-paderborn.de
- University of Paderborn (Germany)
-