| 1 | (* Variables, a loop, calls with arguments and a narrow integer: the |
| 2 | status is the sum of 1 to 10, 55, plus 200 cut to a U8, 255 *) |
| 3 | module Loop; |
| 4 | |
| 5 | var total: INT; |
| 6 | |
| 7 | proc add(var t: INT; n: INT); |
| 8 | begin |
| 9 | t := t + n; |
| 10 | end; |
| 11 | |
| 12 | proc main*: INT; |
| 13 | var i, sum: INT; b: U8; |
| 14 | begin |
| 15 | i := 1; |
| 16 | while i <= 10 do |
| 17 | add(sum, i); |
| 18 | INC(i); |
| 19 | end; |
| 20 | total := sum; |
| 21 | b := 200; |
| 22 | b := b + 200; |
| 23 | if total = 55 then return total + INT(b) - 144; end; |
| 24 | return 1; |
| 25 | end; |
| 26 | |
| 27 | end Loop. |