[fpc-pascal] exitcode

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Dec 28 20:19:54 CET 2008

On 28 Dec 2008, at 20:10, Rainer Stratmann wrote:

> Am Sonntag, 28. Dezember 2008 19:41 schrieb Jonas Maebe:
>> 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.

Ah, yes. I forgot about the situation where you just return from the  
main program. Still, I've never before heard of someone doing that and  
it does not seem very clean to me. But I can't immediately think how  
it would break either.


More information about the fpc-pascal mailing list