Re: Handling Errors

"'Ernest' [email protected] [blat]" <[email protected]>
Newsgroups gmane.mail.blat
Message-ID <[email protected]>
A .BAT file can write to another file using ECHO text >(filename)
     (> to over-write an existing file or create a new one,  >> to mod onto an existing file, or create a new one)
You can write another script to wait/delay/loop until the file is created (at the end of the BLAT script), then report it however you want to

Ernest

From: mailto:[email protected] 
Sent: Monday, December 21, 2015 09:30 AM
To: [email protected] 
Subject: [blat] Handling Errors

  
I have a Delphi program - it creates a batch file with a call to Blat - it executes the batch file with ShellExecute( ... ).  Which all works fine.

My problem is that if Blat fails (it did recently because the ISP changed the smtp server name) then I can't get the error fed back into my Delphi program.  The ShellExecute( ... ) is non-modal, Delphi sets the batch running and then ignores it and carries on.  The return value from ShellExecute relates to getting the batch file started, not to any problems the batch file might have.

I could get the batch to dump the errorlevel code into a file and then get the Delphi program to read the file (after an appropriate delay) - but it's all a bit of a cludge

- is there a better way?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.