首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
编写如下程序: Private Sub Command1_Click() Dim x As Integer,y As Integer x=10:y=20 Call fun1(x,y) Print x;y End Sub Private Function f
编写如下程序: Private Sub Command1_Click() Dim x As Integer,y As Integer x=10:y=20 Call fun1(x,y) Print x;y End Sub Private Function f
admin
2018-10-18
16
问题
编写如下程序:
Private Sub Command1_Click()
Dim x As Integer,y As Integer
x=10:y=20
Call fun1(x,y)
Print x;y
End Sub
Private Function fun1(ByVal m As Integer,n As Integer)As Integer
m=m*m:n=n+n
End Function
程序运行后,单击命令按钮Command1,输出结果为
选项
A、10 25
B、10 40
C、100 25
D、100 40
答案
B
解析
在Visual Basic中调用过程时,参数有两种传递形式:按值传递(Byval)和按址传递(Byref),默认为按址传递。其中,当参数按址传递时,如果在引用该参数的过程中改变了形参的值,同时也就改变了传递参数时实参变量的值。本题中fun1的参数m是按值传递的,n是按地址传递的,因此在fun1中对m的改变不会影响实参x,对n的操作会影响实参y。
转载请注明原文地址:https://kaotiyun.com/show/TPFp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
窗体上有一个名称为CD1的通用对话框,一个名称为Command1的命令按钮,相应的事件过程如下:PrivateSubCommand1_Chck()CD1.Filter="AllFile|*.*|TextFile|*.t
以下叙述中错误的是()。
窗体上有一个名称为HScroll1的滚动条,程序运行后,当单击滚动条两端的箭头时,立即在窗体上显示滚动框的位置(即刻度值)。下面能够实现上述操作的事件过程是()。
窗体上有一个名称为Picture1的图片框控件,一个名称为Label1的标签控件,如图所示。现有如下程序:PublicSubdisplay(xAsControl)IfTypeOfxIsLabelThenxC
假定有如下的程序段:DimintVarAsIntegerintvar=TruePrintintVar则输出结果是
构成计算机软件的是
设运行程序时弹出的菜单如图所示.关于该菜单,以下叙述中错误的是( )。
下面不能作为结构化方法软件需求分析工具的是
A、自然连接B、交C、投影D、并A关系R和关系S有公共域,关系T是通过公共域的等值进行连接的结果,符合自然连接,选A。
A、选择B、差C、交D、并B关系T是关系R的一部分,并且是关系R去掉R和S相同的元素,符合差操作。
随机试题
护士在书写交班报告时,首先应写()。
建筑装饰装修工程施工()不经穿管直接埋设电线。
根据调查组织实施主体的不同,统计调查可以分为()。
下列关于期货期权说法正确的是()。[2012年5月真题]
因旅行社原因造成旅游者未能乘坐预定的公共交通工具的,旅行社应赔偿旅游者的直接经济损失,并支付直接经济损失()的违约金。
注册会计师应当制定一个比财务报表重要性水平()的实际执行的重要性金额,以便评估风险和设计进一步的审计程序。
乙遭车祸昏迷在路上,甲途经发现后雇计程车将乙送往医院,并帮其支付医药费,在救助过程中,甲的名牌衣服因染有乙的血渍而不能使用,同时乙的贵重手表遗落在事故地点,甲因疏忽而未能发现。下列与其相关的说法不正确的是()。
Oneofthemoststrikinglyapparentinstancesofextrasensoryperceptionistheprecognitiveexperience,whenapersonhasacom
将考生文件夹下QIU\LONG文件夹中的文件WATER.FOX设置为只读属性。
Don’tgothere.Theywillhaveyou______alotofmoney.
最新回复
(
0
)