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
-
Polymorphism Polymorphism is one of the crucial features of OOP. It means "one name, multiple forms". It is also called as Overlo...
-
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...
-
Adding Controls to the Form There are many controls you can use with your program: Buttons, Text Boxes, Pictures, Scroll Bars and more. You ...
-
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. ...
-
Additional Command Button's Properties Add 1 Command Button to your form, and change the following properties to see what they do. Capti...
-
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 ...
-
FEATURE C C++ JAVA Paradigms Procedural Procedural, OOP, Generic Programming OOP, Generic Programming (from Java 5) Form of Compiled Sour...
-
Once we know of the existence of variables and constants, we can begin to operate with them. For that purpose, C++ integrates operators. Unl...
-
Java Server Pages JavaServer Pages (JSP) technology is the Java platform technology for delivering dynamic content to web clients in a por...
-
XML Web Services A Web Service (XML Web Service) is a unit of code that can be activated using HTTP requests. Stated another way, a Web Serv...
No comments:
Post a Comment