home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / modula2 / 1379 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  2.1 KB

  1. Path: sparky!uunet!caen!uflorida!insect.cis.ufl.edu!bmr
  2. From: bmr@insect.cis.ufl.edu (Benedict Rafanello)
  3. Newsgroups: comp.lang.modula2
  4. Subject: Re: executing from within a modula-program
  5. Message-ID: <37611@uflorida.cis.ufl.edu>
  6. Date: 12 Nov 92 22:29:29 GMT
  7. References: <16490.2AFB1912@puddle.fidonet.org>
  8. Sender: news@uflorida.cis.ufl.edu
  9. Organization: Univ. of Florida CIS Dept.
  10. Lines: 40
  11. Nntp-Posting-Host: insect.cis.ufl.edu
  12.  
  13. In article <16490.2AFB1912@puddle.fidonet.org>, Hubert.Mock@p1.f67.n246.z2.fidonet.org (Hubert Mock) writes:
  14. |> Hi Ronald,
  15. |>  > I use Topspeed modula 3.1 and had a problem in my last program. Does
  16. |>  > anyone know how Ii can execute another program from a modula program so
  17. |>  > that this modula program is removed from memory (the program is stopped
  18. |>  > and so may be removed from memory). This program is a menusystem that
  19. |>  > executes other programs. If i choose a program the program must execute
  20. |>  > it and remove the modula program. Thus the problem is how i can do this
  21. |>  > !! Please answer if you know it. Very much obliged...
  22. |> 
  23. |> The easiest solution would be if you leave your menusystem-program with setting different errorlevels. In a batchfile you can start other programs depending on the errorlevel.
  24. |> 
  25. |> I hope this will solve your problem.
  26. |> 
  27. |> Servus,
  28. |>           Hubert
  29. |> 
  30. |> 
  31. |> --  
  32. |> uucp: uunet!m2xenix!puddle!2!246!67.1!Hubert.Mock
  33. |> Internet: Hubert.Mock@p1.f67.n246.z2.fidonet.org
  34.  
  35. An interesting variation on this technique which is more flexible is the 
  36. following:
  37.  
  38. 1)  Have your menu system called from a batch file, lets say Menu.bat
  39. 2)  The last instruction in this bat file is another bat file,
  40.     say Choice.bat.
  41. 3)  When your user makes a selection, your menu program creates
  42.     Choice.bat.  The last line in Choice.bat will be Menu.bat.
  43. 4)  Your program terminates.
  44.  
  45. What happens here is that DOS does not check for the existence of
  46. Choice.bat until it actually tries to call it.  So your menu program
  47. is free to create (or modify) Choice.bat as it needs.  When it exits,
  48. DOS calls Choice.bat and does whatever your program put in Choice.bat.
  49.  
  50. Hope this helps.
  51.  
  52. Ben
  53.