...bunch of If statements? Im making a survey with 15 questions.The question has 5 responses, ex.. Always,Usually, Sometimes, Seldom, and Never. Is there an shorter way for me fill the array in VB.net? This is how I have it programmed so far.
If question1AlwaysRadioButton.Checked Then
responseInteger(0, 0) += 1
ElseIf question1UsuallyRadioButton.Checked Then
responseInteger(0, 1) += 1
ElseIf question1SometimesRadioButton.Checked Then
responseInteger(0, 2) += 1
ElseIf question1SeldomRadioButton.Checked Then
responseInteger(0, 3) += 1
ElseIf question1NeverRadioButton.Checked Then
responseInteger(0, 4) += 1
ElseIf question2AlwaysRadioButton.Checked Then
responseInteger(1, 0) += 1
ElseIf question2UsuallyRadioButton.Checked Then
responseInteger(1, 1) += 1
ElseIf question2SometimesRadioButton.Checked Then
responseInteger(1, 2) += 1
ElseIf question2SeldomRadioButton.Checked Then
responseInteger(1, 3) += 1
ElseIf question2NeverRadioButton.Checked Then
responseInteger(1, 4) += 1
End If
Yea, but its telling me I have to use a two-Dimensional array to accumulate the number of each response for each question. I also have to use radio buttons with each question in a groupbox.
If question1AlwaysRadioButton.Checked Then
responseInteger(0, 0) += 1
ElseIf question1UsuallyRadioButton.Checked Then
responseInteger(0, 1) += 1
ElseIf question1SometimesRadioButton.Checked Then
responseInteger(0, 2) += 1
ElseIf question1SeldomRadioButton.Checked Then
responseInteger(0, 3) += 1
ElseIf question1NeverRadioButton.Checked Then
responseInteger(0, 4) += 1
ElseIf question2AlwaysRadioButton.Checked Then
responseInteger(1, 0) += 1
ElseIf question2UsuallyRadioButton.Checked Then
responseInteger(1, 1) += 1
ElseIf question2SometimesRadioButton.Checked Then
responseInteger(1, 2) += 1
ElseIf question2SeldomRadioButton.Checked Then
responseInteger(1, 3) += 1
ElseIf question2NeverRadioButton.Checked Then
responseInteger(1, 4) += 1
End If
Yea, but its telling me I have to use a two-Dimensional array to accumulate the number of each response for each question. I also have to use radio buttons with each question in a groupbox.