Bug? for loop

Daestrum

Expert
Licensed User
Longtime User
if I use
B4X:
for a = 1.0 to 100.0 step 1
   ......
next
all works as expected.
if I change the step value to 0.5 then the for loop no longer executes.

Could it be because a is not defined as float / double ?
 

Daestrum

Expert
Licensed User
Longtime User
That was my point, the for-next doesn't require a pre registered variable, you can just make one up on the fly
for a = ...
for b = ...
a and b don't need to be defined

Maybe it should give a warning that the control variable is not the same class as the value in the 'step' part of the loop.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…