IslandMedic Member Licensed User Longtime User Dec 4, 2015 #1 Code: Copy Sub color_buttons( pushed_button As Int) For i = 1 To 16 Button(i).color = Colors.LightGray If pushed_button = i Then Button(i).color = Colors.DarkGray End If Next End Sub the idea is when one button is pushed need to reset the color on all others and set the one pushed to dark gray. is this possible to iterate over all the buttons instead of one at a time? thanks
Code: Copy Sub color_buttons( pushed_button As Int) For i = 1 To 16 Button(i).color = Colors.LightGray If pushed_button = i Then Button(i).color = Colors.DarkGray End If Next End Sub the idea is when one button is pushed need to reset the color on all others and set the one pushed to dark gray. is this possible to iterate over all the buttons instead of one at a time? thanks
IslandMedic Member Licensed User Longtime User Dec 4, 2015 #2 found the answer... https://www.b4x.com/android/forum/threads/variabe-names-build-with-iteration.12754/#post-71855 Upvote 0
found the answer... https://www.b4x.com/android/forum/threads/variabe-names-build-with-iteration.12754/#post-71855