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
-
In previous chapters, you learned to how to connect to SQL Server 2005 using management studio. In this chapter, you will learn how to creat...
-
A "service" is an application that can start automatically when the computer starts. There are two start up modes: 1. Automatic - ...
-
Differences Between Java and C/C++ It is no secret that the Java language is highly derived from the C and C++ languages. Because C++ is cur...
-
This chapter talks about installing SQL Server Express. If you have a licensed version of full SQL Server 2005, you can follow the same step...
-
Data Access with Server Explorer Visual Basic allows us to work with databases in two ways, visually and code. In Visual Basic, Server Explo...
-
What is the Server ? All advanced database management systems include some kind of service applications as part of the database system. For ...
-
In one of the previous chapters, you learnt how to use Windows Service Control Manager to start/stop SQL Server services. Microsoft provides...
-
SQL Server Express is a free, easy to use, redistributable version of SQL Server 2005 designed for building simple data-driven applications....
-
In the previous chapter, you learned how to connect to SQL Server Database Server . In this chapter, you can find more about how to use Mana...
-
Using SQL Parameters In VB.NET, we have Windows controls that may provide parameters for filtering data from the database. A common scenario...
No comments:
Post a Comment