1. Hello World Introduction
In the first applet, create a new command control in the form, double-click the control to enter the code edit for the clicked event, code as follows, click Command Control, pop up the message box after editing is done Welcome you into the world of VB "
Sub Command1_Click ()2 " welcome you into the world of VB "End sub
2. Basic data types
1. Character type (String)
2. Numeric type
3. Object type
4. Variant type
5. Logic type
6. Date type
3. Custom data types
The syntax format is as follows:
Type datatype name
Data type element name as type name
Data type element name as type name
..................
End Type
4. Variable naming rules
1. cannot be a keyword
2. Can only be composed of letters, numbers and underscores
3. Must start with a letter
4. The number of characters must be within 255.
5. Case-Insensitive letters
6. Must be unique within the scope of validity
5. Variable Scope classification
1. Local Variables
2. Module variables
3. Global variables
6. Constants
% integral type
& Long Integer type
! Single-precision floating-point type
# double-precision floating-point type
@ Currency type
$ string Type
7. Arithmetic operators
+ addition operation
-Subtraction operation or negative
* Multiplication operation
/floating-point division
\ integer Division
Mod modulo operation
^ Exponential arithmetic
8. Relational operators
< less than
<= less than or equal to
< greater than
< greater than or equal
< equals
<> Not equal to
9. Logical operator (value of True as -1,false value as 0)
The and logical and two quantities are true before returning true
Or logical OR returns TRUE if there is a quantity of true
XOR logic XOR only two amount one true, one is false, returns true
The not logic does not negate the value of the variable
Returns True if the Eqv logic equals two quantities at the same time true or false at the same time
LMP logic implication returns true as long as it is not a variable 1 is true and the variable 2 is false
10. Arrays
The syntax format is as follows:
Dim array name ([subscript lower bound to] subscript upper limit [, [subscript lower bound to] subscript upper limit] ...) [As Data type]
Dim MyStr (5) as String
Dim mystr (4,5) as String
vb.net-001