Loops/Wrong ranges: Difference between revisions
Content added Content deleted
(PascalABC.NET) |
Langurmonkey (talk | contribs) |
||
Line 1,961: | Line 1,961: | ||
{{trans|Python}} |
{{trans|Python}} |
||
<syntaxhighlight lang="langur"> |
<syntaxhighlight lang="langur"> |
||
val data = qs:block END |
|||
start stop increment comment |
start stop increment comment |
||
-2 2 1 Normal |
-2 2 1 Normal |
||
Line 1,974: | Line 1,975: | ||
END |
END |
||
# Process data string into table. |
|||
⚫ | |||
# We could have just started with a list of lists, of course. |
|||
⚫ | |||
⚫ | |||
val .f = fn .x: number .x |
|||
⚫ | |||
⚫ | |||
⚫ | |||
} |
} |
||
for |
for test in rest(table) { |
||
val |
val start, stop, inc, comment = test |
||
{ |
{ |
||
val |
val s = series(start .. stop, inc) |
||
catch { |
catch { |
||
writeln "{{ |
writeln "{{comment}}\nERROR: {{_err'msg:L200(...)}}\n" |
||
} else { |
} else { |
||
writeln "{{ |
writeln "{{comment}}\nresult: {{s}}\n" |
||
} |
} |
||
} |
} |