Nested function: Difference between revisions
Content deleted Content added
m →{{header|Wren}}: Changed to Wren S/H |
PascalABC.NET |
||
Line 1,300: | Line 1,300: | ||
=={{header|Pascal}}== |
=={{header|Pascal}}== |
||
''See [[#Free Pascal|Free Pascal]]'' |
''See [[#Free Pascal|Free Pascal]]'' |
||
=={{header|PascalABC.NET}}== |
|||
<syntaxhighlight lang="delphi"> |
|||
procedure MakeList(separator: string); |
|||
var counter := 1; |
|||
procedure MakeItem; |
|||
begin |
|||
Write(counter, separator); |
|||
case counter of |
|||
1: Writeln('first'); |
|||
2: Writeln('second'); |
|||
3: Writeln('third'); |
|||
end; |
|||
counter += 1; |
|||
end; |
|||
begin |
|||
MakeItem; |
|||
MakeItem; |
|||
MakeItem; |
|||
end; |
|||
begin |
|||
MakeList('. '); |
|||
end. |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
1. first |
|||
2. second |
|||
3. third |
|||
</pre> |
|||
=={{header|Perl}}== |
=={{header|Perl}}== |