未分类题

在窗体上画1个名称为Command1的命令按钮和2个名称分别为Text1、Text2的文本框,如图所示,然后编写如下程序:
Function Fun(x As Integer,ByVal y As Integer)As Integer
x=x+y
If x<0 Then
Fun=x
Else
Fun=y
End If
End Function
Private Sub Command1_Click()
Dim a As Integer,b As Integer
a=-10:b=5
Text1.Text=Fun(a,b)
Text2.Text=Fun(a,b)
End Sub
程序运行后,单击命令按钮,Text1和Text2文本框显示的内容分别是______和______。

A.Text=Fun(a,b)
Text2.Text=Fun(a,b)
End

【参考答案】


-5 5
该题考查传值参数和传址参数的区别。Visual Basic通过......

(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)