#368 all Regina versions (3.3, 3.4, 3.5 3.6)

open
Mark Hessling
5
2012-05-26
2012-05-26
Anonymous
No

Regina REXX isn't processing DO loops with a non-non-negative increment (BY).

Here's an example:

111111111111111111111111111111111
\*PROG11*/
do j=10 by -1 to 2
say j
end
111111111111111111111111111111111

output is (as expected):

10
9
8
7
6
5
4
3
2

Now, example 2:
222222222222222222222222222222222
\*PROG22*/
do j=10 by 0 to 2
say j
end
222222222222222222222222222222222

It has no output (as expected).

Now, for the bug:
333333333333333333333333333333333
/*prog33*/
do j=10 by -0 to 2
say j
j=j-1
end
333333333333333333333333333333333

The output is:

10
9
8
7
6
5
4
3
2

(And, of course, this isn't an endorsement of DO loop index modification.)

________________________________ Gerard Schildberger

Discussion

  • The two REXX programs' first comment \*prognn*/ ----- the first character should be a forward slash (/), I don't know how they got changed into a backslash. The error still persists. _____________________________ Gerard Schildberger