Mega Code Archive

 
Categories / Delphi / Examples
 

Returning applications exit code

Question: How do I return an exit code to the calling application or batch file from a Windows Console mode application written in Delphi? Answer: Call the Halt procedure, passing the exit code you wish to return. Example: begin Halt(2) end.