Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Nested-function/REXX/nested-function.rexx
Normal file
14
Task/Nested-function/REXX/nested-function.rexx
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/*REXX program demonstrates that functions can be nested (an outer and inner function).*/
|
||||
ctr= 0 /*initialize the CTR REXX variable.*/
|
||||
call MakeList '. ' /*invoke MakeList with the separator.*/
|
||||
exit 0 /*stick a fork in it, we're all done. */
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
MakeItem: parse arg sep,text; ctr= ctr + 1 /*bump the counter variable. */
|
||||
say ctr || sep || word($, ctr) /*display three thingys ───► terminal. */
|
||||
return
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
MakeList: parse arg sep; $= 'first second third' /*obtain an argument; define a string.*/
|
||||
do while ctr<3 /*keep truckin' until finished. */
|
||||
call MakeItem sep, $ /*invoke the MakeItem function. */
|
||||
end /*while*/
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue