Call a function in a shared library: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: added whitespace, used a template for the output section.) |
(→{{header|REXX}}: added more error checking, added comments and whitespace.) |
||
Line 1,622: | Line 1,622: | ||
The example is using the standard library that is supplied with Regina REXX that contains a wide range of functions. |
The example is using the standard library that is supplied with Regina REXX that contains a wide range of functions. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
A little extra boilerplate code was added to make sure the return codes were OK. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
if rca\==0 then do /*examine the return code.*/ |
|||
say 'return code' rca "from rxFuncAdd" /*tell about bad " " */ |
|||
exit rca /*exit this program with RC. */ |
|||
end |
|||
⚫ | |||
/* |
rcl= sysLoadFuncs() /*we can load the functions. */ |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
y= sysTextScreenSize() /*Y now contains two words: rows cols */ |
|||
parse var y rows cols . /*obtain the two numeric words in Y. */ |
|||
say 'rows=' rows /*display the number of (terminal) rows*/ |
|||
say 'cols=' cols /* " " " " " cols*/ |
|||
⚫ | |||
⚫ | |||
say 'return code' rcd "from sysDropFuncs" /*tell about bad " " */ |
|||
exit rcd /*exit this program with RC. */ |
|||
end |
|||
exit 0 /*stick a fork in it, we're all done. */</lang> |
|||
{{out|output|text= (which happens to reflect the program's author's particular screen size for the "DOS" window):}} |
{{out|output|text= (which happens to reflect the program's author's particular screen size for the "DOS" window):}} |
||
<pre> |
<pre> |