Variable and Operation in Visual Basic
Variable
Variable in Visual Basic can say as a place to hold a value and saved temporarily in computer memory, temporary means, the value will always be saved in computer, as long as the computer is not turn off / restart, For easier and to differentiate with other variables, the variable was given an identity, it could be a number, letter, to word, for example name = Blues Pedia and no = 1, "name" and "no" is a variable, while the "Blues Pedia" and 1 is the value of the variable. Based on the value, Variable distinguished become:
Variable | Description |
Boolean | For binary value, True or False |
Byte | For integer value, with value between 0 to 256 |
Integer | For integer value, with value between -32 768 till 32,768 (15 bits) |
Long | For integer value, with length of 31 bits |
Single | For fractional value of -1038 up to 1038 |
Double | For fractional value from -10108 to 10108 |
String | For non-numeric or string value, such as to save the address. (This variable can not be used for arithmetic operations) |
Date | Date To date value |
Variant | Is an independent variable, which holds the value depends on the value of what is accommodated first. This variable which an excess of visual basic (could even be a shortage of higher programming) |
Based on its use, variable can be divided into:
- Local variable is variable that is used in one function, usually used for simple calculations.
- Global form variable is a variable that is used only for one form only, to its locate usually located at the top of the script, such as Dim a as a single
- Variable Global Project is a variable that is used for a single project, the difference with the global form, even if you move of the form, variable can still be used for other forms, for the locate usually separate, made module, example of the program is Input Data
Operator
Operator is a symbol / mark of an operation, the following list:
Operator | USE |
ARITMATIKA | |
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Division |
^ | Rank |
mod | The rest of the division |
\ | The result of the division round |
& | Merger string |
RELASI | |
= | Equal to |
< | Smaller |
<= | Less then, equal to |
> | Greater |
>= | Greater, equal to |
<> | Tidak sama |
LOGIKA | |
AND | True, If the value of both variables are same |
OR | True, if one of the variable based on criteria |
NOT | In contrast, of the requested |
That is the explanation of the variable and operation, but on the other there is also called Expression, for an explanation I will discuss in the next tutorial, so still visit the Blues Pedia for other interesting tutorials.
Enough and Thank you, Hopefully Helpful