在窗体上画一个名称为Command1的命令按钮,并编写如下过程: Private Sub Command1_Click() Dim x AS Integer Static y As Integer x=10

admin2010-09-11  27

问题 在窗体上画一个名称为Command1的命令按钮,并编写如下过程:    Private Sub Command1_Click()       Dim x AS Integer       Static y As Integer       x=10       y=5       Call f1(x, y)       Print x,y    End Sub    Private Sub f1(ByRef x1 As Integer, y1 As Integer)       x1=x1+2       y1=y1+2    End Sub    程序运行后,单击命令按钮,在窗体上显示的内容是______。

选项 A、10 5
B、12 5
C、10 7
D、12 7

答案D

解析 在形参中,默认的传送方式为传地址传送,所以形参x1和y1都按传地址传送。最后,实参x为12,实参y为7。
转载请注明原文地址:https://jikaoti.com/ti/atg0FFFM
0

最新回复(0)