executing from within a modula-program 
Author Message
 executing from within a modula-program

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...

--  
uucp: uunet!m2xenix!puddle!2!292!812!Ronald.Roosemeyers



Sun, 16 Apr 1995 06:25:03 GMT  
 executing from within a modula-program
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



Sat, 22 Apr 1995 11:26:00 GMT  
 executing from within a modula-program

Quote:
>  > 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

You want EXEC33 (or a later version).

This is a public domain utility library written by Thomas Wagner which could
be compiled under TopSpeed C or Pascal and linked with you Modula2 program.
You may also need masm.

Docs in English/German as are the program messages! (compile for whichever you
want).

It is reputed to be very good, handles all sorts of swapping disk, xms, etc.
etc. and will even pass the environment.

I have looked at but not used this program (expect where other people are
using it and I use their software). It may take a little porting to TopSpeed.

  TC.



Thu, 27 Apr 1995 11:27:04 GMT  
 executing from within a modula-program

 > 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

This is a procedure which stuffs a character into the keyboard buffer,
and may be of use to you.  Stuff the buffer, then exit your program.

PROCEDURE Stuff( c : CHAR );
VAR
   R : SYSTEM.Registers;
BEGIN
    R.AH := 05H;
    R.CL := c;
    R.CH := 0;
    Lib.Intr( R, 16H );
END Stuff;

The keyboard buffer will only hold around 16 characters, so you can't
overdo it...
--
--------------------------------------------------------------------
Mark A. Morrell     Disclaimer:  _I_ probably don't even believe it.
Literary Reference:  The introduction to Cervantes' Don Quixote.



Sun, 30 Apr 1995 09:28:34 GMT  
 executing from within a modula-program

:  > 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
:
: This is a procedure which stuffs a character into the keyboard buffer,
: and may be of use to you.  Stuff the buffer, then exit your program.
:
  [stuff deleted]

That's not one of the better ways of doing it.  TopSpeed supplies an
Execute procedure in Lib if I remember correctly.  They've actuallt
got two flavours, Execute and ExecuteCmd.  The former can only be used
to execute binaries (ie. .COM or .EXE files) and the latter is passed
a complete DOS commandline (like C's system command) which is then
executed under COMMAND.COM (actually %COMSPEC) so that you can also
run batch files.  The easiest way to locate it in the libaries is to
type it in the editor, put the cursor over it and hit F1.

Andries
***********************************************************************
*       /|~~\ * APJ Dippenaar        * "If you wanna make the world a *

*   /    |    * Univ of Stellenbosch *  yourself and make a change."  *
* /   \__|    * South Africa         *             -- Michael Jackson *
***********************************************************************



Mon, 01 May 1995 18:12:26 GMT  
 executing from within a modula-program

|> 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

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



Tue, 02 May 1995 06:29:29 GMT  
 executing from within a modula-program

Quote:


>:  > 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
>:
>: This is a procedure which stuffs a character into the keyboard buffer,
>: and may be of use to you.  Stuff the buffer, then exit your program.
>:
>  [stuff deleted]

>That's not one of the better ways of doing it.  TopSpeed supplies an
>Execute procedure in Lib if I remember correctly.  They've actuallt
>got two flavours, Execute and ExecuteCmd.  The former can only be used
>to execute binaries (ie. .COM or .EXE files) and the latter is passed
>a complete DOS commandline (like C's system command) which is then
>executed under COMMAND.COM (actually %COMSPEC) so that you can also
>run batch files.  The easiest way to locate it in the libaries is to
>type it in the editor, put the cursor over it and hit F1.

Well, the message requested a way to leave the program, and then execute
the command.  Neither of these will do that for you.  BTW, there is a
third flavor to execute a command within JPI M2:  Exec.  The Execute
command requires you to allocate space for the program to run in, and
the Exec command does not.  Exec also allows you to pass an alternate
DOS environment to the command, while Execute does not.
--
--------------------------------------------------------------------
Mark A. Morrell     Disclaimer:  _I_ probably don't even believe it.
Literary Reference:  The introduction to Cervantes' Don Quixote.


Sat, 06 May 1995 01:01:36 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. executing dos program within program

2. Q: Executing programs from within a program

3. executing a file from within a program

4. Executing an external program from within a TSR

5. Executing an external program from within a TSR

6. Execute program from within starpack

7. Newbie Question (executing Program from within)

8. executing a shell command within AWK

9. Executing Sql code on Sybase from within VW

10. executing block at toplevel from within a class

11. Executing from within a M

12. executing from within a

 

 
Powered by phpBB® Forum Software