[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 141
  • Last Modified:

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.
Gary
0
GaryHandley
Asked:
GaryHandley
2 Solutions
 
atul_parmarCommented:
Just set ExitCode before you quit/terminate your application
e.g.
ExitCode := 1;
0
 
David_WardCommented:
Halt(0);
Halt(1);

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now