Working With Integers
The process of creating variable called "Declaring"
To Declare (=create) Integer variable simply write:
Dim MyTest As Integer
What does the line above do?
It creates an Integer variable with the name MyTest.
Dim = Declare
MyTest = the name of the new variable
As Integer = The new variable type will be Integer.
Now you can put a number inside this variable.
You can do that by simple write:
MyTest = 10
The line above will insert the number 10 into the MyTest variable.
Now the MyTest variable stores the Number 10, but how
can you access this value from your program?
You can do that using the variable name. Example:
Print MyTest
The line above will write 10 on the form.
Pay attention to the differents between
Print MyTest
and
Print "MyTest"
Where you putting a text inside quotes (Like in the bottom line),
Visual Basic treat it as a Text, and will print it As-Is.
The Print "MyTest" Line will print MyTest on the form.
Where you putting a text Without quotes (Like in the upper line),
Visual Basic treat it as a variable name, and will print the value that found
in the variable.
The Print MyTest Line will print the value that found in
the MyTest variable, therefore it will print 10 on the form.
Popular Posts
-
Introduction: In this exercise, you are going to build and run a sample Java program called CommandLineusing NetBeans. The sample program c...
-
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...
-
*Servlets are Java programs running on a web server that produce results viewed remotely on web server. *Servlets has the same purpos...
-
MSDE stands for Microsoft Desktop Engine. MSDE is replaced with Microsoft SQL Server 2005 Express. MSDE is a free, light weight version of S...
-
SQL Server Express is a free, easy to use, redistributable version of SQL Server 2005 designed for building simple data-driven applications....
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Using JavaServer Pages...
-
The SQL ORDER BY clause comes in handy when you want to sort your SQL result sets by some column(s). For example if you want to select all t...
-
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. ...
-
Using functions we can structure our programs in a more modular way, accessing all the potential that structured programming can offer to us...
-
Working With Integers The process of creating variable called "Declaring" To Declare (=create) Integer variable simply write: Dim ...
No comments:
Post a Comment