====Click here for Download this video or Watch online===


Here Are codes for add button


Dim a As Integer
        Dim b As Integer
        Dim c As Integer
        a = 5
        b = 3
        c = a + b
        MessageBox.Show(c, "sum of a and b is")

Here is code for subtract button

Dim a As Integer
        Dim b As Integer
        Dim c As Integer
        a = 5
        b = 3
        c = a - b
        MessageBox.Show(c, "subtraction of b from a")


Here is explanation


Dim a As Integer
Dim b As Integer
a = 5
 b =3
That's code from Visual Basic Net. It's VB's way of setting up (or declaring) variables.
Here's a breakdown of the variable Declaration:

Dim
Short for Dimension. It's a type of variable. You declare (or "tell" Visual Basic) that you are setting up a variable with this word. We'll meet other types of variables later, but for now just remember to start your variable declarations with Dim.
a
This is the cardboard box and the sticky label all in one. This is a variable. In other words, our storage area. After the Dim word, Visual Basic is looking for the name of your variable. You can call your variable almost anything you like, but there are a few reserved words that VB won't allow. It's good practice to give your variables a name appropriate to what is going in the variable.
As Integer
We're telling Visual Basic that the variable is going to be a number (integer). Well meet alternatives to Integer later.
a =5
The equals sign is not actually an equals sign. The = sign means assign a value of. In other words, here is where you put something in your variable. We're telling Visual Basic to assign a value of 3 to the variable called number1. Think back to the piece of paper going into the cardboard box. Well, this is the programming equivalent of writing a value on paper

Regards dsp@nimbuzz.com

0 comments:

Post a Comment

 
Top