home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!destroyer!fmsrl7!lynx!nmsu.edu!death
- From: death@acca.nmsu.edu (Jeff Garzik)
- Subject: Re: can't get EXEC to work
- Message-ID: <1992Sep1.105502.7542@nmsu.edu>
- Sender: usenet@nmsu.edu
- Organization: New Mexico State University
- X-Newsreader: Tin 1.1 PL5
- References: <la5469INNgd2@langtry.cs.utexas.edu>
- Date: Tue, 1 Sep 1992 10:55:02 GMT
- Lines: 34
-
- Joel Daniel Just (joel@cs.utexas.edu) wrote:
- : I am having trouble getting the EXEC command to work in Turbo Pascal v5.0 on
- : the PC. Here is an example program:
- :
- : PROGRAM TEST;
- : USES DOS;
- : BEGIN
- : EXEC('dir','');
- : WRITELN('DONE')
- : END.
- :
- : When I run this program, 'DONE' is printed, and nothing else happens. The
- : EXEC command doesn't seem to be executed, no matter what I put in between the
- : two sets of quotes in the EXEC call. Even if I put garbage between the
- : quotes, I don't get an error. I just get 'DONE' and that's it.
-
- This question pops up every so often... You need to make sure you have
- enough memory to execute the Exec call. Try adding the {$M 8192,0,0}
- directive at the start of the program, as well as SwapVectors calls before
- and after the Exec call.
-
- Finally, never forget to check the DosError variable. This probably would
- have told you what you need to know in the first place.
-
- However, except for some small jobs, you will want heap and the ability to
- Exec, such as creating a DOS shell. TurboPower software offers a public
- domain "ExecSwap" unit which will do just that with a minimum of hassel.
- Their Object Professional also has a lot of helpful Exec routines.
-
- --
- "Only sheep need a leader." - Nomeansno
-
- death@acca.nmsu.edu
-
-