首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
编写如下程序: Private Sub Command 1_SClick() Dim x As Intege,y As Integer x=10:y=20 Call funl(x,y) Print x;y End Sub Private Function
编写如下程序: Private Sub Command 1_SClick() Dim x As Intege,y As Integer x=10:y=20 Call funl(x,y) Print x;y End Sub Private Function
admin
2015-05-29
12
问题
编写如下程序:
Private Sub Command 1_SClick()
Dim x As Intege,y As Integer
x=10:y=20
Call funl(x,y)
Print x;y
End Sub
Private Function fun l(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),默认为按址传递。其中,当参数按址传递时,如果在引用该参数的过程中改变了形参的值,同时也就改变了传递参数时实参变量的值。本题中funl的参数m是按值传递的,n是按地址传递的,因此在funl中对m的改变不会影响实参x,对n的操作会影响实参y。
转载请注明原文地址:https://kaotiyun.com/show/VCQp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
在结构化程序设计思想提出之前,在程序设计中曾强调程序的效率。与程序的效率相比,人们更重视程序的
设有如下程序PrivateSubFormClick()DimaAsInteger,bAsIntegera=20:b=50p1a,bp2a,b
在窗体上画一个命令按钮Command1,然后编写如下代码:PrivaeSubCommand1_Click()DimArr1(10)AsInteger,Arr2(10)AsIntegern=3F
设R是一个2元关系,S是一个3元关系,则下列运算中正确的是()。
下列程序段的执行结果为()。DimA(3,3)ForM=1To3ForN=1To3IfN=MOrN=3-M+1ThenA(M,N)=1
获取文本框中被选取的文本内容的属性是()。
下列叙述中错误的是()。
VisualBasic提供了列表框控件,当列表框中的项目较多。超过了列表框的长度时,系统会自动在列表框边上加一个【】。
设有下面的循环。i=0Whilei<=1i=i+3PrintiWend则运行后的输出结果是
按条件f对关系R进行选择,其关系代数表达式为______。
随机试题
“文化大革命”结束的标志是
金属桥用栅栏式的铸道其优点A.各个铸道的长度一致,有利于防止收缩变形B.各个铸道的长度一致,有利于铸件的切割C.各个铸道的长度一致,有利于包埋D.各个铸道的长度一致,有利于铸造E.各个铸道的长度一致,有利于操作
A.补气升提B.健脾利湿C.补肾固脱D.温肾纳气E.收涩固脱
建设项目所处的地区不同,决定了其建设费用的项目类别及其费率存在差异。()
《建设工程安全生产管理条例》规定,不属于监理单位安全生产管理责任和义务的是( )。
某甲在一胡同口抢劫一女青年钱包,抢到钱包后,突然发现该女青年是自己的邻居,于是将钱包当面送还给女青年,并声称刚才的行为是开玩笑的。某甲的行为是()。
企业收到投资者以外币投入的资本,无论是否存在合同约定汇率,均不采用合同约定汇率折算,应采用交易日即期汇率折算,外币投入资本与相应的货币性项目的记账本位币金额相等,不产生外币资本折算差额。()
行为目标描述的是()。
材料一:今年2月27日,全国“两会”前夕,国务院总理温家宝时隔一年之后二次与网友进行在线交流。在两个小时的访谈中,温家宝坦诚深入地回答了网友们内心的诸多问题。在谈到最近两次受到广泛关注的“问题奶粉”时,温总理重申“企业家的身上应该流淌着道德的血液。”今年4
(1)新民主主义理论(2)列宁主义(3)剩余价值理论(4)农村包围城市理论(5)科学发展观
最新回复
(
0
)