Loop For X times
Im tring to get X amount of boxes to fill depending on random number. Im only getting 1
Thanks
10 Replies
Does the loop only run once?
Or do you only get one box added?
1 boz gets added
box
If i goto my station button and back again i only get 1 more box
try creating Random outside of that method
1
Use the debugger to see what's going on
Maybe
amount
is always 1
?[DOTNET] 5
[DOTNET] 5
[DOTNET] 5
[DOTNET] 5
[DOTNET] 5
?
Is it due to only having one Boxview?
That time it gave me random number of 5
x
and y
are assigned values only once, which is before the loop
so even if amount
gets assigned to 6 (for example), since x
and y
are never reassigned in the loop, then, the coordinates of all 6 of the BoxView
items will be the same, and will hence overlap on the UI and and therefore appear as only one
thats the only thing i can come up with that could be wrong with the code