: : : :
This message was edited by bpajk at 2003-10-21 12:12:5
: : : : My program doesn't go pass the exec() statement! How do I tell him to execute and go foward? When I used Dev-Pascal for a compiler it went passed but in Free-pascal it stops at exec().
: : : :
: : : : program test;
: : : : uses dos;
: : : : begin
: : : : swapvectors;
: : : : exec('c:\windows\notepad.exe','');
: : : : swapvectors;
: : : : readln
: : : : end.
: : : :
: :
: : :
: : : What flavour of FPC? If it's the GO32V2 one, you may need to use:
: : :
: : :
: : : exec(GetEnv('COMSPEC'), '/C c:\windows\notepad.exe');
: : :
: : :
: : :///////////////////////////////////////////////////////////////////
: : Try is one:
: : : program test;
: : : uses dos;
: : : begin
: :
: : : command := '/c' + 'windows\notepad.exe' ;
: : : swapvectors;
: : : exec(getenv('COMSPEC'), command);
: : : swapvectors;
: : :////////////////////////////////////////////////////////////////////
: :
: : May you can help me in closing that program (written in perl)
: : Best Regards
: : Werner
:
:
: Was that a suggestion for bpajk to try, or are you asking for help with that code?
:
It worked! But There is a trick to this:
If you use: exec('c:\windows\notepad.exe',''); It will not pass the exec() statement until the program is finished, but if you use: exec(GetEnv('COMSPEC'), '/Cc:\windows\notepad.exe'); it will execute the program and go pass. Thanx!