Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to define variables in vb
How to define variables in vb
The answer upstairs is wrong.

Dim a and b are integers indicating that:

A variant variable A and an integer variable bDim are defined, and local variables can also be declared in the form of: Static Private Public.

& lt public | private | Dim | static & gt& lt variable name > [as data type]

Description:

( 1)& lt; Public | Private | Dim | Static & gt Choose one of four options to determine the scope and lifetime of the variable.

(2)[ As data type] is used to define the data types of variables, such as integer and simplex. Parentheses indicate that the content can be omitted. When the data type of a variable is omitted, the default data type of the variable is Variant.

(3) A statement can declare multiple variables, and the declared variables are separated by commas. For example:

Dim intNum is an integer and strName is a string.

Declare an integer or string variable.

(4) After the variable is declared, the system will automatically assign an initial value to the variable, and the default value of the numerical variable is 0; The default value of a variable-length string variable is an empty string.