Wednesday, August 18, 2010

Variables

A variable is like a bucket with a whole heap of events in it.
Dim means 'remember this'.
Eg Dim myname As String. This means to remember myname as a string variable.
Eg. Dim number As Integer. This means to remember the number as an integer variable.
Eg. Dim point As Decimal. This menas to remember that decimal as a deciaml variable.
Note: Rnd ( ) generates a random number between 0 and 0.9999999

In the code of button one I put: number = Rnd ( )

Label1.Text = number
and this goes after Handles Button1.Click

In the code of button two I put: point = Rnd ( )
Label2.Text = point
this goes after Handles Button2.Click

In the code of button three I put myname = TextBox1.Text
Label3.Text = myname
this goes after Handles Button3.Click
Here is the finished product:

No comments:

Post a Comment