Question[Help]Arguments

Posts 1–6 of 6 · Page 1 of 1
[Help]Arguments
I have some trouble.
The code highlighted in red doesnt seem to work.
When "ComboBox7.Text = ComboBox8.Text" it will still continue with GoTo done.
How can I fix this error?


First Off here is the code:
Code:
        If ComboBox7.Text = ComboBox8.Text Or ComboBox7.Text = ComboBox9.Text Or ComboBox8.Text = ComboBox9.Text Then
            MessageBox.Show("You have two or more of the same perk.", "Error!", MessageBoxButtons.OK, MessageBoxIcon******rmation)
        Else
            GoTo done
        End If

done:
        If ComboBox1.Text = ComboBox3.Text Or ComboBox1.Text = ComboBox6.Text Or ComboBox3.Text = ComboBox6.Text Then
            MessageBox.Show("You have two or more of the same weapon.", "Error!", MessageBoxButtons.OK, MessageBoxIcon******rmation)
        Else
            Dim fil As StreamWriter
            fil = New StreamWriter("C:\weapons.txt")
As A Test, This worked for me.

[php]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ComboBox1.Text = ComboBox1.Text Then 'ComboBox7.Text = ComboBox9.Text Or ComboBox8.Text = ComboBox9.Text Then
MessageBox.Show("You have two or more of the same perk.", "Error!", MessageBoxButtons.OK, MessageBoxIcon******rmation)
Else
MsgBox("It Works")
End If
End Sub
[/php]

Maybe it is the "Or Statments"

Try ElseIf
What nextgen said basically, im would be willing to bet it is the or statements that are giving you trouble.
Yeah, using And and and and or using or or or or or , not really a good concept, better off using ElseIf

But,I think there is another underlining issue, Im looking for it right now.


Here you go

this will work

[php]
Dim one As String
one = ComboBox1.Text
Dim Two As String
Two = ComboBox2.Text


If one = Two Then
MessageBox.Show("You have two or more of the same perk.", "Error!", MessageBoxButtons.OK, MessageBoxIcon******rmation)
Else
MsgBox("It Works")
End If
[/php]


SO in your case

Dim one as string = Combobox7.text
Dim Two as string = Combobox8.text

and so forth

the `GoTo Done` function is not working properly.
i tested it out and it wasnt right.
Are you getting an error, or what, cause above worked for me.
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us