I have a double FOR NEXT loop. It runs fine:
But when I insert a IF ELSE ENDIF clause, I get a compilation error: the compiler thinks a "NEXT" was missing, like here:
By the way, "iv" and "room_img" are ImageViews. room_img is an array of ImageViews.
Strange. What to do?
B4X:
For devil_no = 1 To 100
delay = 1000 - 10 * speed.Value ' delay after the devil has finished before next
comment.text = "Teufel Nummer " & devil_no & "laeuft jetzt..."
For room = devil_no To 100 Step devil_no
Next ' room
Next ' devil_no
But when I insert a IF ELSE ENDIF clause, I get a compilation error: the compiler thinks a "NEXT" was missing, like here:
B4X:
For devil_no = 1 To 100
delay = 1000 - 10 * speed.Value ' delay after the devil has finished before next
comment.text = "Teufel Nummer " & devil_no & "laeuft jetzt..."
For room = devil_no To 100 Step devil_no
iv = room_img(room)
If room_state(room) = 0 ' room is open, so close it
room_state(room) = 1
iv.bitmap = LoadBitmap(File.DirAssets, "Door_opened_35.png")
Else
room_state(room) = 0 ' room is closed, so (re)open it
iv.bitmap = LoadBitmap(File.DirAssets, "Door_closed_35.png")
End If
Next ' room
Next ' devil_no
By the way, "iv" and "room_img" are ImageViews. room_img is an array of ImageViews.
Strange. What to do?