Shop OBEX P1 Docs P2 Docs Learn Events
SPIN2 repeat ... from ... to ... step ... BUG? — Parallax Forums

SPIN2 repeat ... from ... to ... step ... BUG?

In SPIN1 the following Code
	D := 2
	repeat Index from 5 to 10 step D
		--D
Index is: 5, 6, 6, 5, 3 {Spin1 Manual v1.1 Page 192}

In SPIN2
	D := 2
	repeat Index from 5 to 10 step D
		--D
		debug(sdec(Index,D))

Cog0  Index = 5, D = 1
Cog0  Index = 7, D = 0
Cog0  Index = 9, D = -1
Var D is manipulated in the loop but the step size is constantly 2

Comments

  • RaymanRayman Posts: 13,901
    I think Chip said that is how it is supposed to work in Spin2.
    The from, to, and step only get evaluated once.
Sign In or Register to comment.