My first attempt at a simple button click procedure.. never used programming language before, and it looks like a mess. But I need to know why every time debug I get all my varibles equaling eachother.
What I'm trying to do with this program is two things. The first is to successfully store a table of numbers in a dataset, in the format kind of like a social security number. Six separate memory boxes (##-##-##-##-##-##) Then be able to input numbers and manipulate the database numbers. (i.g see if the input numbers match any of the database numbers.) I don't know if that makes much sense, but that's the idea.
What I'm trying to do with this program is two things. The first is to successfully store a table of numbers in a dataset, in the format kind of like a social security number. Six separate memory boxes (##-##-##-##-##-##) Then be able to input numbers and manipulate the database numbers. (i.g see if the input numbers match any of the database numbers.) I don't know if that makes much sense, but that's the idea.
VB.NET:
Option Strict On
Option Explicit On
Public Class Form1
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim isempty As Boolean
isempty = Txt1.Text = ""
isempty = Txt2.Text = ""
isempty = Txt3.Text = ""
isempty = Txt4.Text = ""
isempty = Txt5.Text = ""
isempty = Txt6.Text = ""
If isempty Then MsgBox("You can't leave them empty!!", MsgBoxStyle.OkOnly, "Press OK if you're a dumbass")
If isempty Then Txt1.Clear()
If isempty Then Txt2.Clear()
If isempty Then Txt3.Clear()
If isempty Then Txt4.Clear()
If isempty Then Txt5.Clear()
If isempty Then Txt6.Clear()
Dim loto1 As Integer
Dim loto2 As Integer
Dim loto3 As Integer
Dim loto4 As Integer
Dim loto5 As Integer
Dim loto6 As Integer
Dim iswrongnumber As Boolean
iswrongnumber = loto1 > 47
iswrongnumber = loto2 > 47
iswrongnumber = loto3 > 47
iswrongnumber = loto4 > 47
iswrongnumber = loto5 > 47
iswrongnumber = loto6 > 47
If iswrongnumber Then MsgBox("Your number must be between 1 and 47 *******", MsgBoxStyle.OkOnly, "Press OK if you're a dumbass")
If iswrongnumber Then Txt1.Clear()
If iswrongnumber Then Txt2.Clear()
If iswrongnumber Then Txt3.Clear()
If iswrongnumber Then Txt4.Clear()
If iswrongnumber Then Txt5.Clear()
If iswrongnumber Then Txt6.Clear()
Dim isequa As Boolean
isequa = loto1.Equals(loto2)
isequa = loto1.Equals(loto3)
isequa = loto1.Equals(loto4)
isequa = loto1.Equals(loto5)
isequa = loto1.Equals(loto6)
isequa = loto2.Equals(loto1)
isequa = loto2.Equals(loto3)
isequa = loto2.Equals(loto4)
isequa = loto2.Equals(loto5)
isequa = loto2.Equals(loto6)
isequa = loto3.Equals(loto1)
isequa = loto3.Equals(loto2)
isequa = loto3.Equals(loto4)
isequa = loto3.Equals(loto5)
isequa = loto3.Equals(loto6)
isequa = loto4.Equals(loto1)
isequa = loto4.Equals(loto2)
isequa = loto4.Equals(loto3)
isequa = loto4.Equals(loto5)
isequa = loto4.Equals(loto6)
isequa = loto5.Equals(loto2)
isequa = loto5.Equals(loto3)
isequa = loto5.Equals(loto4)
isequa = loto5.Equals(loto1)
isequa = loto5.Equals(loto6)
isequa = loto6.Equals(loto2)
isequa = loto6.Equals(loto3)
isequa = loto6.Equals(loto4)
isequa = loto6.Equals(loto5)
isequa = loto6.Equals(loto1)
If isequa Then MsgBox("Your numbers cannot be equal dick", MsgBoxStyle.OkOnly, "Press OK if you're a dumbass")
If isequa Then Txt1.Clear()
If isequa Then Txt2.Clear()
If isequa Then Txt3.Clear()
If isequa Then Txt4.Clear()
If isequa Then Txt5.Clear()
If isequa Then Txt6.Clear()
End Sub
End Class
Last edited: