Call a function in a shared library: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: added a comment to the REXX section header.)
m (→‎{{header|REXX}}: changed capitalization and some comments, changed whitespace.)
Line 1,626: Line 1,626:


The dropping of functions isn't really necessary for most REXX programs.
The dropping of functions isn't really necessary for most REXX programs.
<lang rexx>/*REXX program calls a function (sysTextScreenSize) in a shared library (regutil). */
<lang rexx>/*REXX program calls a function (sysTextScreenSize) in a shared library (regUtil). */


rca= rxFuncAdd('sysloadfuncs', "regutil", 'sysloadfuncs') /*add a function library. */
rca= rxFuncAdd('sysLoadFuncs', "regUtil", 'sysLoadFuncs') /*add a function library. */
if rca\==0 then do /*examine the return code.*/
if rca\==0 then do /*examine the return code.*/
say 'return code' rca "from rxFuncAdd" /*tell about bad " " */
say 'return code' rca "from rxFuncAdd" /*tell about bad " " */
Line 1,640: Line 1,640:
end
end


/* [↓] call a particular function. */
/* [↓] call a function. */
y= sysTextScreenSize() /*Y now contains two words: rows cols */
$= sysTextScreenSize() /*$ has 2 words: rows cols */
parse var y rows cols . /*obtain the two numeric words in Y. */
parse var $ rows cols . /*get two numeric words in $.*/
say 'rows=' rows /*display the number of (terminal) rows*/
say ' rows=' rows /*show number of screen rows.*/
say 'cols=' cols /* " " " " " cols*/
say ' cols=' cols /* " " " " cols.*/


rcd= SysDropFuncs() /*clean up: make functions inaccessible*/
rcd= SysDropFuncs() /*make functions inaccessible*/
if rcd\==0 then do /*examine the return code.*/
if rcd\==0 then do /*examine the return code.*/
say 'return code' rcd "from sysDropFuncs" /*tell about bad " " */
say 'return code' rcd "from sysDropFuncs" /*tell about bad " " */
Line 1,654: Line 1,654:
{{out|output|text=&nbsp; (which happens to reflect the program's author's particular screen size for the "DOS" window):}}
{{out|output|text=&nbsp; (which happens to reflect the program's author's particular screen size for the "DOS" window):}}
<pre>
<pre>
rows= 62
rows= 62
cols= 96
cols= 96
</pre>
</pre>