Thread View: comp.lang.modula2
3 messages
3 total messages
Started by Andy Blake
Tue, 16 Apr 1996 09:46
Executing Files From Modula 2
Author: Andy Blake
Date: Tue, 16 Apr 1996 09:46
Date: Tue, 16 Apr 1996 09:46
12 lines
968 bytes
968 bytes
I am wondering if there is any simple way in which I can run executable files (such as an MS-DOS command) from Modula 2. All of the ways that I have seen up to now involve complex file handles and other data. I would like to know if there is any 'simple' way to run a command from compiled modula 2 code?? Thanks, ________________________________________________________________________ Andrew Blake The University Of Huddersfield
Re: Executing Files From Modula 2
Author: Peter Moylan
Date: Wed, 17 Apr 1996 23:42
Date: Wed, 17 Apr 1996 23:42
26 lines
1684 bytes
1684 bytes
Andy Blake (c9550044@hades.hud.ac.uk) wrote:
>I am wondering if there is any simple way in which I can run executable
>files (such as an MS-DOS command) from Modula 2. All of the ways that I
>have seen up to now involve complex file handles and other data.
This is an implementation-specific issue; there's no way to do
it portably because the details depend on things like which
operating system you're using, therefore there's no way to
build it into the language. It has to be done via library
modules.
What you need to do is read the library documentation for
whichever compiler you're using. Some compilers come with
an easy-to-use library procedure to do the job, and some don't.
A general comment to all beginners (though I doubt that it'll
do any good): if you want to ask questions like this, then you
need to specify which compiler you're using, which operating
system, etc. If the question is too vague then you're unlikely
to get a useful answer.
--
Peter Moylan peter@ee.newcastle.edu.au
http://www.eng.newcastle.edu.au/ee/Moylan.html
OS/2 freeware list at
http://www.eng.newcastle.edu.au/ee/Moylan/os2/os2info.html
Re: Executing Files From Modula 2
Author: Pavel Sakov
Date: Fri, 19 Apr 1996 04:33
Date: Fri, 19 Apr 1996 04:33
16 lines
1007 bytes
1007 bytes
Andy Blake wrote:
>
> I am wondering if there is any simple way in which I can run executable
> files (such as an MS-DOS command) from Modula 2. All of the ways that
With TopSpeed 1.17 you write:
Storage.ALLOCATE( address, MAX( CARDINAL));
error_code := Lib.Execute( program, command_line, address,12000);
IF error_code # 0 THEN
... (* error, DOS error code = error_code *)
END
Storage.DEALLOCATE( address, MAX( CARDINAL));
Thats all.
Pavel Sakov
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads