Returning an error code from a command-line driven program

Hi, I have written a simple exe that the user calls from the command line with various parameters. I can display messages if things go wrong, but some customers want error codes returned so that they can integrate it into their applications. But I am unsure how to do this. This is a windows application written in Delphi 7. I want to return a 0 or 1 etc.

Many thanks.
Who is Participating?
atul_parmarConnect With a Mentor Commented:
Just set ExitCode before you quit/terminate your application
ExitCode := 1;
David_WardConnect With a Mentor Commented:

... Halt(254) ... etc
GaryHandleyAuthor Commented:
Many thanks, I knew it had to be something simple, but it was eluding me :-) Both solutions are useful, thanks.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.