文档介绍:VB 重点串讲笔记(VB focuses on lecture notes)
notes of key points
VB key points notes
The first chapter is the foundaDo < statement block > Loop While < < condition >
Format four: Do < statement block > Loop Until < < condition >
double circulation 1. typical case: ask for less than 100 prime number. 2. take the elements on the diagonal of the matrix. 3. print "*" pattern.
procedure example:
Const, n=5, m=4
Dim a (m, n)
Private, Sub, Command 1_Click ()
K=1
For i=l To M
For j=l To n
A (I, J) =k
K=k+1
Next J
Next I
End Sub
Private, Sub, Command2_Click ()
Summ=0
For i=l To M
For j=l To n
If, i=l, Or, i=m, Then
Summ=summ+a (I, J)
Else
If, j=I, Or, j=n, Then
Summ=summ+a (I, J)
End If
End If
Next J
Next I
Print summ
End Sub
The process Commandl_Click () acts as a matrix in a two-dimensional array where 1 rows of N rows are stored in a, and the function of the process Comma, nd2_Click () is m (A) compute the sum and B of the elements of a circle on the periphery of a matrix) compute the sum of all elements other than one circle except the matrix
C) compute the sum and D of the first column and the last column of the matrix, compute the sum of the first and last elements of the matrix
The fourth chapter. Static array fourth chapter static array
Format: Option, Base, N function: set the array index from N.
Format: LBound (array name [dimension]) form