>>>>>IF thisform.MoverList.ListIndex < thisform.MoverList.ListCount >>>>> thisform.MoverList.ListIndex = thisform.MoverList.ListIndex+1 >>>>>ELSE >>>>> thisform.MoverList.ListIndex = 1 >>>>>ENDIF >>>>>>>>>
>>>>thisform.MoverList.ListIndex = (thisform.MoverList.ListIndex+1) % thisform.MoverList.ListCount + 1 >>>>>>>
>>>thisform.MoverList.ListIndex = (thisform.MoverList.ListIndex+1) % (thisform.MoverList.ListCount + 1) >>>>>>
>ListIndex = 4 >ListCount = 10 >>>>thisform.MoverList.ListIndex = (thisform.MoverList.ListIndex+1) % thisform.MoverList.ListCount + 1 >Result: (4+1) % 10 + 1 = 6 && increment by 2, precedence of % is higher than + >>
>ListIndex = 4 >ListCount = 10 >thisform.MoverList.ListIndex = (thisform.MoverList.ListIndex+1) % (thisform.MoverList.ListCount + 1) >Result: (4+1) % (10 + 1) = 5 && goes one up > >Problem: >ListIndex = 10 >ListCount = 10 >Result: (10+1) % (10 + 1) = 0 >>>>
>thisform.MoverList.ListIndex = thisform.MoverList.ListIndex % thisform.MoverList.ListCount + 1 >Right. Written without to think.