若要在子过程Proc1调用后返回两个变量的结果,下列过程定义语句中有效的是( )。
A:Sub Proc1(n,m) B:Sub Proc1(ByVal n,m) C:Sub Proc1(n,ByVa1 m) D:Sub Proc1(ByVa1 n,ByVa1 m)
单击命令按钮时,下列程序代码的执行结果为______。
Private Sub Proe1 (n As Integer,ByVa1 m As Integer)
n=n Mod 10
m=m/ 10
End Sub
Private Sub Command1_Click( )
Dim x As Integer
Dim y As Integer
x= 12
y = 34
Call Proe1 (x, y)
Print x; y
End Sub
A:12 34 B:2 34 C:2 3 D:12 3
若要在子过程Proc1调用后返回两个变量的结果,下列过程定义语句中有效的是( )。
A:Sub Proc1(n, B:Sub Proc1(ByVal n, C:Sub Proc1(n,ByVa1 D:Sub Proc1(ByVa1 n,ByVa1
单击命令按钮时,下列程序代码的执行结果为______。 Private Sub Proe1 (n As Integer,ByVa1 m As Integer) n=n Mod 10 m=m/ 10 End Sub Private Sub Command1_Click( ) Dim x As Integer Dim y As Integer x= 12 y = 34 Call Proe1 (x, y) Print x; y End Sub
A:12 34 B:2 34 C:2 3 D:12 3
在窗体上添加一个名称为Command1的命令按钮,然后编写如下程序:
Private Sub f(ByVa1 x As Integer)
x=x+4
End Sub
Private Sub Command1_Click( )
i=3
Call f(1)
If i>4 Then i=i*2
MsgBox i
End Sub
打开窗体运行后,单击命令按钮,则消息框的输出结果为______。
单击命令按钮时,下列程序代码的执行结果为 Public Sub proc1(n As Integer,Byva1 m As Integer) n=n Mod 10 m=m Mod 10 End Sub Private Sub Cmmand1_Click( ) Dim x As Integer,y As lngeger x=12:y=12 Call Proe1(x,y) Print x;y End Sub
A:12 2 B:2 12 C:2 2 D:12 12
设有如下程序
Private Sub Search(a( )As Variant,ByVa1 key As Variant,index%)
Dim I%
For I=LBound(a) To UBound(a)
If key=a(1) Then
index=I
Exit Sub
End If
Next I
index=I
End Sub
Private Sub Form_Load( )
Show
Dim b( ) As Variant
Dim n As Integer
b = Array(1,3,5,7,9,11,13,15)
Call Search(b, 11 ,n)
Print n
End Sub程序动行后,输出结果是 【15】 。
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click( ) Call sub1(-15.1,2.54) End Sub Public Function sub1(a As Integer,ByVa1 b As String) As Integer a=Val(b) sub1=a Print sub1 End Function 程序运行后,单击命令按钮,在窗体上输出的是
A:3 B:2 C:-15 D:提示出错