Board index » delphi » Heeelp! Pb with .BAT file calling an EXE file (created with Pascal)
excoff...@lyon.cemagref.fr (David Excoffier)
Wed, 18 Jun 1902 08:00:00 GMT
Heeelp! Pb with .BAT file calling an EXE file (created with Pascal)
I'vfe created a pascal program which tests if further files exist or not on a
If a file tested doesn't exist, the program displays on the screen the error
(which file doesn't exist), and stops immediately.
It works fine while i call the executable program directly from dos.
But i've to call this program on a batch file.
I call my executable program with Call c:\xxx\myprog.exe
It works fine while no errors occurs.
But when an error occurs, the program pascal displays the error, breaks, and
the batch file continue as if no errors where detected.
If i call my pascal program without using the 'call' instruction in the batch
file, the program works fine but stops immediately after, even if no error
So my question is very simple :
Is it possible to send from my pascal program to the batch file, when an error
occurs, a code error (e.g. errorlevel, or something else), which can be
understood by the batch file to test if an error has occured during the
execution of the program pascal and then break the batch.???
If yes, how can i do ?
(I use Turbo Pascal 5)
Thank you for all who help me to resolve this problem.
P.S.: sorry for my disgraceful english...