Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › opening programs within pascal
New Posts  All Forums:Forum Nav:

opening programs within pascal

post #1 of 2
Thread Starter 
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
Escobar
(9 items)
 
Supercomputer ^_^
(13 items)
 
 
CPUMotherboardGraphicsRAM
1055T M4A88T-D EVO USB3 ATI 6850 4 GB 
Optical DriveOSMonitorKeyboard
DVD RW Windows 8 Pro lp1900 + 2 X 15 inch dell Microsoft Comfort Curve 
PowerCase
600watt thermaltake antec 200 
  hide details  
Reply
Escobar
(9 items)
 
Supercomputer ^_^
(13 items)
 
 
CPUMotherboardGraphicsRAM
1055T M4A88T-D EVO USB3 ATI 6850 4 GB 
Optical DriveOSMonitorKeyboard
DVD RW Windows 8 Pro lp1900 + 2 X 15 inch dell Microsoft Comfort Curve 
PowerCase
600watt thermaltake antec 200 
  hide details  
Reply
post #2 of 2
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.
Hope that helps
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › opening programs within pascal