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
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Using JavaServer Pages...
-
Please do this exercise at the command line instead of using NetBeans. This is to learn the concept of classpath without the help of NetBean...
-
1 Introducing the .NET Framework with C# The .NET Framework is such a comprehensive platform that it can be a little difficult to descr...
-
Working With Integers The process of creating variable called "Declaring" To Declare (=create) Integer variable simply write: Dim ...
-
INTRODUCTION TO 'C': C is a programming language developed at AT & T's Bell laboratories of USA in 1972.it was designed by d...
-
STRINGS: The way a group of integers can be stored in an integer array, similarly a group of characters can be stored in a character array. ...
-
More About Ascii How can I know what is the Ascii value of a specific character? Use the Asc command. For example, the following line: Print...
-
Using functions we can structure our programs in a more modular way, accessing all the potential that structured programming can offer to us...
-
4.5 Using FCL Documentation for Types Using the SDK documentation for a given type will likely be a daily or even hourly event when ...
-
Microsoft SQL Server SQL Server is one of the most popular and advanced database systems currently available. SQL Server is provided by Micr...
No comments:
Post a Comment