请教几道vb题

来源:百度知道 编辑:UC知道 时间:2024/06/16 20:56:04
从子过程退出并返回主调过程,可使用语句
A exit b return C exit sub D stop sub

public temp as integer
sub test()
dim temp as integer
temp=5
end sub
private sub form-load ()
temp=3
call text
text1.text=temp
end sub

程序题有问题,不能正常运行,再看看是不是写错了 call text 改为:test
其结果是3,因为这里没有参数传递

选择题选C

程序题是文本框将会显示5,因为temp是public变量

要退出子程序可以用 exit sub ,但楼主的意思好像是要地址传递,你直接将temp的地址传递就可以实现了,程序如下:

Private Sub Form_Load()
Dim temp As Integer
temp = 3
Call test(temp)
Text1.Text = temp
End Sub
Sub test(temp As Integer)
temp = 5
End Sub

exit sub