I am trying to convert a PASCAL program from an IBM mainframe version to GNU Pascal. I fixed a couple of trival implementation details (such as <> instead of ^= and NOT for ^) but I have one problem left I can't figure out how to solve. 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. How can I do this in GNU Pascal? My Pascal is 15 years rusty and I don't have a manual handy. I couldn't find anything in the binary distribution nor in the Web help. Am I going to have to do this by printing a value and then parsing the output? Thanks, Ian Sinclair Software Development Engineer Nortel Networks, Belleville, ON CA mailto:sinclair@nortelnetworks.com
On Wed, 18 Apr 2001, Ian Sinclair wrote:
I am trying to convert a PASCAL program from an IBM mainframe version to GNU Pascal. I fixed a couple of trival implementation details (such as <> instead of ^= and NOT for ^) but I have one problem left I can't figure out how to solve.
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.
How can I do this in GNU Pascal? My Pascal is 15 years rusty and I don't have a manual handy. I couldn't find anything in the binary distribution nor in the Web help. Am I going to have to do this by printing a value and then parsing the output?
A call to Halt should do what you want, Halt seems to be USCD Pascal extension supported by GPC. However the version of GPC I have at hand allows only recognition of zero or non-zero value returned to the OS - when I call Halt(1) the number 42 is reported in $?. Adam Naumowicz -------------------------------------- WWW: http://math.uwb.edu.pl/~adamn/ --------------------------------------
Adam Naumowicz wrote:
A call to Halt should do what you want, Halt seems to be USCD Pascal extension supported by GPC. However the version of GPC I have at hand allows only recognition of zero or non-zero value returned to the OS - when I call Halt(1) the number 42 is reported in $?.
Oops... my mistake. Will be fixed soon. Thanks for the report. Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/ GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html
participants (3)
-
Adam Naumowicz -
Frank Heckenbach -
Ian Sinclair