We can assign values to those variables,after declaring various variables using the Dim statements.
A D V E R T I S E M E N T
The general format of an assignment is
variable=Expression and the variable can be a declared variable or a control property value. The expression could be a mathematical expression, a number, a string, a Boolean value ( false or true) and etc.
The following are some examples:
We need to use various mathematical operators in order to compute inputs from users and to generate results.In Visual Basic, except for + and -, the symbols for the operators are different from normal
mathematical operators as shown in following table:
remainder from an integer division)
15 Mod 4=3
the decimal places)
+ or &
The following example describe the use of operator in VB
Dim firstName As String
Dim secondName As String
Dim yourName As String
Private Sub Command1_Click()
firstName = Text1.Text
secondName = Text2.Text
yourName = secondName + " " + firstName
Label1.Caption = yourName
In this example, three variables are declared as string and for variables secondName and firstName will receive their data from the userís input into textbox1 and textbox2, and
the variable yourName will be assigned the data by combining the first two variables.
Finally, yourName is displayed on the Label1.
Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
Working With Variables,
asp net variables,
shell script variables,
working with php,
working with mysql,
working with unix,
working with perl,
working with asp,
working with excel,
working with iis,
working with xml,