Jump to content

Nested function: Difference between revisions

Added XPL0 example.
(Added Wren)
(Added XPL0 example.)
Line 1,550:
 
makeList.call(". ")</lang>
 
{{out}}
<pre>
1. first
2. second
3. third
</pre>
 
=={{header|XPL0}}==
<lang XPL0>proc MakeList(Separator);
char Separator;
int Counter;
 
proc MakeItem;
int Ordinals;
[IntOut(0, Counter);
Text(0, Separator);
Ordinals:= [0, "first", "second", "third"];
Text(0, Ordinals(Counter));
CrLf(0);
];
 
for Counter:= 1 to 3 do MakeItem; \MakeList procedure
 
MakeList(". ") \main procedure</lang>
 
{{out}}
772

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.