🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #1511

Re: executing from within a modula-program

#1511
From: Benedict Rafanello
Date: Thu, 12 Nov 1992 22:29
40 lines
2207 bytes
In article <16490.2AFB1912@puddle.fidonet.org>, Hubert.Mock@p1.f67.n246.z2.fidonet.org (Hubert Mock) writes:
|> Hi Ronald,
|>  > I use Topspeed modula 3.1 and had a problem in my last program. Does
|>  > anyone know how Ii can execute another program from a modula program so
|>  > that this modula program is removed from memory (the program is stopped
|>  > and so may be removed from memory). This program is a menusystem that
|>  > executes other programs. If i choose a program the program must execute
|>  > it and remove the modula program. Thus the problem is how i can do this
|>  > !! Please answer if you know it. Very much obliged...
|> 
|> 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.
|> 
|> I hope this will solve your problem.
|> 
|> Servus,
|>           Hubert
|> 
|> 
|> --  
|> uucp: uunet!m2xenix!puddle!2!246!67.1!Hubert.Mock
|> Internet: Hubert.Mock@p1.f67.n246.z2.fidonet.org

An interesting variation on this technique which is more flexible is the 
following:

1)  Have your menu system called from a batch file, lets say Menu.bat
2)  The last instruction in this bat file is another bat file,
    say Choice.bat.
3)  When your user makes a selection, your menu program creates
    Choice.bat.  The last line in Choice.bat will be Menu.bat.
4)  Your program terminates.

What happens here is that DOS does not check for the existence of
Choice.bat until it actually tries to call it.  So your menu program
is free to create (or modify) Choice.bat as it needs.  When it exits,
DOS calls Choice.bat and does whatever your program put in Choice.bat.

Hope this helps.

Ben
Technical Details
Message-ID: <37611@uflorida.cis.ufl.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!caen!uflorida!insect.cis.ufl.edu!bmr
References: <16490.2AFB1912@puddle.fidonet.org>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!caen!uflorida!insect.cis.ufl.edu!bmr
From: bmr@insect.cis.ufl.edu (Benedict Rafanello)
Newsgroups: comp.lang.modula2
Subject: Re: executing from within a modula-program
Message-ID: <37611@uflorida.cis.ufl.edu>
Date: 12 Nov 92 22:29:29 GMT
References: <16490.2AFB1912@puddle.fidonet.org>
Sender: news@uflorida.cis.ufl.edu
Organization: Univ. of Florida CIS Dept.
Lines: 40
Nntp-Posting-Host: insect.cis.ufl.edu