[fpc-pascal] exitcode

Rainer Stratmann RainerStratmann at t-online.de
Sun Dec 28 20:10:58 CET 2008


Am Sonntag, 28. Dezember 2008 19:41 schrieb Jonas Maebe:
> On 28 Dec 2008, at 19:31, Rainer Stratmann wrote:
> > Am Sonntag, 28. Dezember 2008 18:59 schrieb Jonas Maebe:
> >> On 28 Dec 2008, at 18:16, Rainer Stratmann wrote:
> >>> Where is the earliest position to set the exitcode?
> >>
> >> What do you mean with "position"?
> >
> > Which unit first executes to set the exitcode as early as possible.
>
> The exit code is initialised as 0. You cannot set it to something else
> without at the same time terminating the program (using the halt()
> procedure). Well, you can change it, but it will be overwritten with
> the actual exit code when the program really terminates (the parameter
> of halt, or a run time error number).
>
> Jonas

Here with Linux OS it works if I set the exitcode var.
Nothing overwritten by the program.

program1 calls program2 and program2 says with the exitcode if program1 
restarts program2 or finish all.

That works without calling halt(), if no error occurs.

Rainer



More information about the fpc-pascal mailing list