Working With Integers (Continue)
Answer:
0
20
Blah
30
Why is that?
Lets pass over the code line after line:
Dim Blah As Integer
A new Integer with the name Blah has been declared
Print Blah
Will print the Value that found in the Blah variable.
But there is nothing in the Blah variable!
The Blah variable has just been declared, and we
didn't put inside it any value yet.
The default value of any integer variable is 0.
When you write :
Dim Blah As Integer
It's like you've written:
Dim Blah As Integer
Blah = 0
So it will print the value that found right now
in the Blah variable - 0
Blah = 10
Now the Blah variable holds the number 10
Blah = 20
Now the Blah variable holds the number 20
What's happened to the 10 that was inside it?
It has been deleted!
A variable can holds only one value, and when
you put in it a value, the old value is being immediately deleted.
So what is the differents between
Blah = 20
and
Blah = 10
Blah = 20
?
There is no differents!
In both cases the Blah variable will hold the number 20
Print Blah
Will print the value that found right now
in the Blah variable - 20
Blah = 30
Now the Blah variable holds the number 30
Print "Blah"
Will print the Text that found between the quotes - Blah
Print Blah
Will print the value that found right now
in the Blah variable - 30
Popular Posts
-
Inserting Records The following code inserts a Record into the Jobs table in Pubs sample database. Drag a button onto the form and place the...
-
OPERATORS: There are 7 operators they are: 1.Arithmetic operators : +,-,*,/,% : addition,subtraction,multiply,division...
-
We will use the Customers table to illustrate the SQL LIKE clause usage: FirstName LastName Email DOB Phone John Smith John.Smith@yaho...
-
Introduction: In this exercise, you will exercise the concept of pass by reference. Please not that primitive type parameters are passed ...
-
Additional Form's Properties The Form has many of the Command Button's properties (MousePointer, BackColor, Visible and more). He al...
-
Visual Basic .NET provides the easiest, most productive language and tool for rapidly building Windows and Web applications. Visual Basic .N...
-
JSP pages are high level extension of servlet and it enable the developers to embed java code in html pages. JSP files are finally compiled ...
-
Working With Integers (Continue) Question: What will be printed on the form after executing the following code: Dim Blah As Integer Print Bl...
-
Servlets Life Cycle have the following Components: * Handled by the servlets container. * Create and initialize the servlets. ...
-
Learning about Parameters Parameters are variables that being passed to a Sub. Look at the first line of the Command Button's Click even...
No comments:
Post a Comment