home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / pascal / 8024 < prev    next >
Encoding:
Text File  |  1993-01-10  |  2.2 KB  |  43 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!usenet-feed.cc.umr.edu!gsanchez
  3. From: gsanchez@cs.umr.edu (Guadalupe Sanchez)
  4. Subject: Re: Stuffing DOS command line
  5. References: <34933@adm.brl.mil>
  6. Date: Mon, 11 Jan 1993 01:59:55 GMT
  7. Nntp-Posting-Host: next5.cs.umr.edu
  8. Organization: University of Missouri - Rolla, Rolla, MO
  9. Sender: cnews@umr.edu (UMR Usenet News Post)
  10. Message-ID: <1993Jan11.015955.4322@umr.edu>
  11. Lines: 30
  12.  
  13. In article <34933@adm.brl.mil> CHARPER%COLGATEU.bitnet@cunyvm.cuny.edu writes:
  14. >Hi y'all.  I haven't yet received any mail from this list, so I don't know if
  15. >this is the right kind of question to address here, but I joined in order to
  16. >ask this question:
  17. >
  18. >Some years ago I worked with MS-Pascal, and used a method to load a desired
  19. >string into the DOS command line, so that that command was executed when the
  20. >application completed.  This was the best way I know of to chain from one
  21. >program to another.  I'm now working with Turbo Pascal 5.0, and would like to
  22. >know if someone has code which will do this in Turbo Pascal. (I don't have the
  23. >MS-Pascal code that did this any longer).  Basically I need something that will
  24. >set the next command to execute WITHOUT using EXEC (I can't afford the memory
  25. >to shell the command).
  26. >
  27. >Thanks,
  28. >**************************************************************************
  29. >Cindy Harper, Systems Librarian                               Case Library
  30. >charper@colgateu                                        Colgate University
  31. >charper@center.colgate.edu                                    13 Oak Drive
  32. >(315) 824-7363                                           Hamilton NY 13346
  33. >**************************************************************************
  34.  
  35.  
  36. The function the Pascal compiler was using was INT 2E - pass command to 
  37. command interpreter for execution, which does exactly what you said.
  38. To call it using assembler:
  39.   have DS:SI point to an ASCIIZ string which is the command line you want
  40.   to pass to COMMAND.COM.  (There must be a CR character at the end right
  41.   before the binary zero)  Then call INT 2E.  As you said, the program
  42.   will execute after the program which calls it exits.
  43.