|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming | |
opening programs within pascal
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | |||||||||
|
*cough* Stock *cough*
|
hello everyone
__________________![]() Im trying to open a .exe from within pascal programing languge ive looked everywhere and cnt find how to ![]() is it possible? Thank you in advance for your help ![]()
|
|||||||||
|
|
|
|
|
#2 (permalink) |
|
New to Overclock.net
|
I've not tried this in Pascal (it's been a long time since I tried anything in Pascal tbh) but there should be an 'exec' procedure to which you pass the path to the program (including it's name) and a string of command line args
Example from Turbo Pascal's Help file: Code:
{ Example for DosExitCode and Exec }
{$M $4000,0,0 } { 16K stack, no heap }
uses Dos;
var
ProgramName, CmdLine: string;
begin
Write('Program to Exec (full path): ');
ReadLn(ProgramName);
Write('Command line to pass to ',
ProgramName, ': ');
ReadLn(CmdLine);
WriteLn('About to Exec...');
SwapVectors;
Exec(ProgramName, CmdLine);
SwapVectors;
WriteLn('...back from Exec');
if DosError <> 0 then{ Error? }
WriteLn('Dos error #', DosError)
else
WriteLn('Exec successful. ',
'Child process exit code = ',
DosExitCode);
end.
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|