I have troubles withe the code below:
// Day additions (use the RadioButton selection) If RB_Kind_Daily.Value And Date_Run.DayOfWeek <> 1 Then // Daily Strips only [No Sunday] Date_Run.Day = Date_Run.Day + 1 ElseIf RB_Kind_Sunday.Value Then // Sunday Strips only Date_Run.Day = Date_Run.Day + 7 ElseIf RB_Kind_All.Value Then // Daily and Sunday Strips [7 days a week] Date_Run.Day = Date_Run.Day + 1 Else // To avoid infinite loop (why Lord, why ?) Date_Run.Day = Date_Run.Day + 1 End If
When I add the Else statement, the code runs correctly (Because in the Else I add 1 day and this is OK in that specific case: pure hazard).
RB_Kind are three RadioButtons. In the case above, the RB_Kind_Daily.Value is True.
The code is in a Do …/… Loop Until dates compares
Nota: there are 3 RadioButtons because there are three Cases: Monday-Saturday, Sundays and Monday -Sunday. That code was working until today. That is why I worked on it today.
Yes, I cleared the Xojo Cache.
Also, I add a log in a Listbox that report the important values: without the Else block, the loop is infinite :(