Ian Sinclair wrote:
Somehow the reply that you sent me is not related to the question that I tried to send to the gpc mailing list. My question was regarding trying to return a value from a pascal program.
I'm not sure what you're referring to. I haven't seen any previous mail of yours on this list, and I don't know who sent to a reply. Anyway, this mail made it to the list, so I can reply. ;-)
The original program had a return code, implemented by a call to RETCODE with a parameter. This was obviously an implementation supplied interface to allow the program to be a function.
I suppose you mean a return value passed back to the calling process. In GPC you can do this with `Halt'. If called without a parameter, it terminates the program and returns 0, the same as when the program reaches the `end.'. Calling `Halt' with an integer parameter will return this value. If a program is terminated by a runtime error, it will return a non-zero value.
Frank