Menu: Difference between revisions
Content added Content deleted
PatGarrett (talk | contribs) (Batch file housekeeping) |
(→{{header|XPL0}}: Removed error message, and clarified the concern with a comment.) |
||
Line 3,132: | Line 3,132: | ||
=={{header|XPL0}}== |
=={{header|XPL0}}== |
||
⚫ | |||
{{incorrect|XPL0|The function should return an empty string if called with an empty list. Please also check if this could really used as a [https://en.wikipedia.org/wiki/Subroutine function aka subroutine.]}} |
|||
<lang XPL0>include c:\cxpl\codes; |
|||
⚫ | |||
func Menu(List); |
func Menu(List); |
||
Line 3,140: | Line 3,138: | ||
int Size, I, C; |
int Size, I, C; |
||
[Size:= List(0); |
[Size:= List(0); |
||
if Size < 1 then return List(0); |
if Size < 1 then return List(0); \if empty list, return pointer to 0 |
||
for I:= 1 to Size-1 do |
for I:= 1 to Size-1 do |
||
[IntOut(0, I); Text(0, ": "); |
[IntOut(0, I); Text(0, ": "); |