0

Guys, I need again your help. I have to generate automatically a unique schedule for each subjects with only one click of a button. I'm having trouble with it. Please suggest....here's my codes:

Do Until conflict = False
                    For y As Integer = 0 To DataGridClass.RowCount - 1
                        If txtbxClassID.Text <> DataGridClass.Rows(y).Cells(ClassID).Value And txtbxSection.Text = DataGridClass.Rows(y).Cells(SectionEnrolled).Value And txtbxDay.Text = DataGridClass.Rows(y).Cells(Day).Value And (timestart >= DataGridClass.Rows(y).Cells(TimeStart).Value And timestart <= DataGridClass.Rows(y).Cells(TimeEnd).Value) Then
                            conflict = True
                            Exit For
                        End If
                        conflict = False
                        y = y + 1
                    Next
                    If conflict = True Then
                        txtbxDay.Text = day(GetRandom(0, 5))
                        timestart = timestart1(GetRandom(0, 15))
                        timeend = timestart + 2
                        txtbxTimeStart.Text = timestart
                        txtbxTimeEnd.Text = timeend
                    End If
                Loop

Please help. I need your suggestions ASAP. Thanks so much.

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by amf101
0

i do not necessarily mean UNIQUE literally but in a way that there should not be conflicts between them. Here's what i wanted to generate from.

Day- MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY
TimeStart and TimeEnd- 7.0, 7.3, 8.0, 8.3, 9.0 and so on...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.