Board index » delphi » How run a program.exe at the end of a pascal program

How run a program.exe at the end of a pascal program

Hello,

I want to make a menu with pascal and so I don't know
how I can run a program like windows with pascal program.

Thanks you.

Wolfman

 

Re:How run a program.exe at the end of a pascal program


Quote
wolf...@mail.imaginet.fr (wolfman) wrote:
>Hello,
>I want to make a menu with pascal and so I don't know
>how I can run a program like windows with pascal program.
>Thanks you.
>Wolfman

you could write a batch file that runs your menu and the menu returns
an "error" code to the batch file which the batch file will then run
windows if needed, and when windows is done the batch file can re-run
your menu program. i am assuming your menu program is a dos program
running in dos.

if you're using turbo pascal (i'm not sure about other compliers) for
dos there is a command that will execute a dos program or whatever.
here is the syntax:

        Exec(Path, CmdLine : String)

        - Path is the path and name of the file
        - CmdLine is the command line paramaters

and i think you will have to adjust your maximun heap space to allow
enough memory for your program to run.

        { $M, <Stack>, <Min Heap>, <Max Heap> }

good luck
dave

Re:How run a program.exe at the end of a pascal program


Quote
wolfman wrote:

> Hello,

> I want to make a menu with pascal and so I don't know
> how I can run a program like windows with pascal program.

> Thanks you.

> WolfmanHere is the source

SWAPVECTORS;
EXEC ('PROGAM.EXE','<SPACE>PARAMETERS');
SWAPVECTORS;

{$M10240,0,1024000} AT THE BEGINNING OF YOUR SOURCE.

Thanks, Pieter De Wit (Jo'Burg)
dewi...@vodacom.co.za

Other Threads