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
-
If you want to do something more complex than insert a simple expression, JSP scriptlets let you insert arbitrary code into the servlet meth...
-
Data Adapter Configuration Wizard In this section we will create our own data adapter, a built-in feature that comes with Visual Basic .NET ...
-
Creating DataTable Visual Basic allows us to create our own Tables and work with them. The DataTable is an in-memory representation of a blo...
-
Steps to follow: 1. Modify Main.java as shown below in Code-11.2.a under personpackage directory. (You are welcome to do this work using ei...
-
SQL Management Studio comes in two flavours: 1. SQL Management Studio This edition comes with all versions of SQL Server 2005 except SQL Ser...
-
4.2 The Framework Class Library Now that you have a taste of the goals and groundwork laid by the CLR and managed code, let’s taste ...
-
As you may already know, the C++ Standard Library implements a powerful string class, which is very useful to handle and manipulate strings ...
-
CONSTANTS,VARIABLES AND KEYWORDS: CONSTANTS: Two types of constants those are: a)primary constants b)secondary constants a)In primary consta...
-
Introduction: In this exercise, you will exercise the concept of comparing objects using String class as an example. Steps to follow: 1. Wri...
-
POINTERS: The pointer has a simple definition that is A value which points towards the address of another value which is called as pointer. ...
No comments:
Post a Comment