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
-
Changing the button's Properties Now you have a button on your form. You can change its location by dragging it, and change its size by ...
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Using JavaServer Pages...
-
Learning about Events (Continue) Lets program the Form_Load event. "MsgBox" is Visual Basic command that launch a message box. for...
-
Dot Net Publish at Scribd or explore others: Presentations & Slid ...
-
Adding Controls to the Form There are many controls you can use with your program: Buttons, Text Boxes, Pictures, Scroll Bars and more. You ...
-
FEATURE C C++ JAVA Paradigms Procedural Procedural, OOP, Generic Programming OOP, Generic Programming (from Java 5) Form of Compiled Sour...
-
Classes (II) Overloading operators C++ incorporates the option to use standard operators to perform operations with classes in addition to w...
-
Methods A Method is a procedure built into the class. They are a series of statements that are executed when called. Methods allow us to han...
-
JSP scripting elements let you insert Java code into the servlet that will be generated from the current JSP page. There are three forms: ...
-
The SQL AVG aggregate function selects the average value for certain table column. Have a look at the SQL AVG syntax: SELECT AVG(Column1) FR...
No comments:
Post a Comment