Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How vb Find the Number of Array Elements
How vb Find the Number of Array Elements
Take the statement dim a(3, -2 to 2, 5) as an example:

Options? Base? 1

Private? Sub? Form _ Click ()

Dim? Me? As? Integer, j? As? Integer, k? As? integer

Dim? Count? As? long

Dim? One (3,? -2? Where to? 2,? 5)? As? integer

For what? Me? =? LBound(a, 1)? Where to? UBound(a, 1)

For what? j? =? LBound(a,2)? Where to? UBound(a,2)

For what? k? =? LBound(a,3)? Where to? UBound(a,3)

Count? =? Count? +? 1

Next? k

Next? j

Next? I

MsgBox? count

End? submarine

Extended data:

Vb common functions:

Len(x) Find the length (number of characters) of a string.

LenB(x) counts the number of bytes in a string.

Mid(x, n 1, n2) takes n2 characters from the position of n 1 on the left of the X string?

Left(x, n) takes n characters from the left of the x string?

Right(X, n) takes n characters from the right of the x string.

String(n, x) returns a string consisting of n first characters.

Space(n) returns n spaces.

Now return to the system date and time.

Year(c) returns the year of the specified date.

Minute () returns the score of the specified time.

Chr(x) converts numerical values (ASCII codes) into characters.

CBool(x) converts a numeric string or value into a Boolean type.

Baidu encyclopedia -Visual Basic