当执行以下程序时,在名为lblResult的标签框内将显示_____。 Private Sub cmdlt_click() Dim I,R R=0 For I=1 To 5 Step 1 R=R+I Next I lblResult.Caption=Str(R) End Sub
举一反三
- 当执行以下程序时,在名为label1的标签框内将显示_____。 Private Sub command1_click() s=0 For I=1 To 5 Step 1 s=s+I Next I label1.Caption=s End Sub
- 有如下VBA程序段: R=0 For I=1 TO 5 Step 2 R=R+I Next I 运行结束后,变量R的值是
- 下列程序的运行结果为( )。 Private Sub Command1_Click() Dim a(5) As String Dim i As Integer For i = 0 To 5 a(i) = i + 1 Print a(i); Next i End Sub
- 以下程序的运行结果是 Sub s1(b() As Integer) For i = 1 To 4 b(i) = 2 * i Next i End Sub Private Sub Command1_Click() Dim a(1 To 4) As Integer For i = 1 To 4 a(i) = i + 5 Next i s1 a() For i = 1 To 4 Print a(i) Next i End Sub
- 运行下面的程序,第二行显示结果是___________。 Private Sub Form_Click() Dim A As Integer Dim i As Integer A = 5 For i = 1 To 9 Call sub1(i, A) Print i, A Next i End Sub Private Sub sub1(x As Integer, y As Integer) Static N As Integer Dim I As Integer For I = 3 To 1 Step -1 N = N + x x = x + 2 Next I y = y + N End Sub