Nested function: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: changed inner function name.) |
m (→{{header|REXX}}: used the separator as per task requirements.) |
||
Line 1,150: | Line 1,150: | ||
<lang rexx>/*REXX program demonstrates that functions can be nested (an outer and inner function).*/ |
<lang rexx>/*REXX program demonstrates that functions can be nested (an outer and inner function).*/ |
||
ctr= 0 /*initialize the CTR REXX variable.*/ |
ctr= 0 /*initialize the CTR REXX variable.*/ |
||
call MakeList . |
call MakeList '. ' /*invoke MakeList with the separator.*/ |
||
exit 0 /*stick a fork in it, we're all done. */ |
exit 0 /*stick a fork in it, we're all done. */ |
||
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
||
MakeItem: parse arg sep,text; ctr= ctr + 1 /*bump the counter variable. */ |
MakeItem: parse arg sep,text; ctr= ctr + 1 /*bump the counter variable. */ |
||
say ctr || sep word($, ctr) |
say ctr || sep || word($, ctr) /*display three thingys ───► terminal. */ |
||
return |
return |
||
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
/*──────────────────────────────────────────────────────────────────────────────────────*/ |