im having alot of problems comparing strings. I tried two different ways which you will still see in this program. but i have the arrayString already populated in the program in a different sub. The user enters in there answer and it will populate that to a different array (answerArray) and then compares the two.
i have tried the breakpoint and input is populating into the answer string... but when it goes to compare it just doesnt compare them right so it wont award correctScoreShort 10 points... what error am i making?
thank you!
i have tried the breakpoint and input is populating into the answer string... but when it goes to compare it just doesnt compare them right so it wont award correctScoreShort 10 points... what error am i making?
thank you!
vbnet Code:
Private Sub checkedButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles checkedButton.Click If answerTextBox.Text = String.Empty Then MessageBox.Show("You did not enter any answer", "ERROR!!", MessageBoxButtons.OK, MessageBoxIcon.Error) Else If questionsCountShort < 10 Then answerArrayString(questionsCountShort) = answerTextBox.ToString [B] If answerArrayString(questionsCountShort).Contains(arrayString(questionsCountShort, 1)) Or _ answerArrayString(questionsCountShort).Contains(arrayString(questionsCountShort, 2)) Or _ answerArrayString(questionsCountShort).Contains(arrayString(questionsCountShort, 3)) Then 'Is arrayString(questionsCountShort, 1) Or _ ' answerArrayString(questionsCountShort) Is arrayString(questionsCountShort, 2) Or _ ' answerArrayString(questionsCountShort) Is arrayString(questionsCountShort, 3) [/B] correctAnswerShort += 10S answerPictureBox = correctPictureBox[/B] Else answerPictureBox = wrongPictureBox End If hintCheckBox.Enabled = True hintCheckBox.Checked = False Else MessageBox.Show("Your are done with you Current Test" & ControlChars.NewLine & _ "You may now text another test if you wish", "Done", MessageBoxButtons.OK) exitButton.Visible = True startOverButton.Visible = True startOverButton.Text = "Take Another Test" startOverButton.Enabled = True End If questionsCountShort += 1S questionAskedLabel.Text = arrayString(questionsCountShort, 0) questionNumberLabel.Text = questionsCountShort.ToString End If answerTextBox.Text = String.Empty answerTextBox.Focus() startOverButton.Enabled = False hintInfoLabel.Visible = False exitButton.Visible = False End Sub