首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设窗体上有一个Command1命令按钮,还有以下程序代码: Private Sub Command1_Click() Static x As Integer x = x + 1 Call proc(x) Print x, E
设窗体上有一个Command1命令按钮,还有以下程序代码: Private Sub Command1_Click() Static x As Integer x = x + 1 Call proc(x) Print x, E
admin
2019-03-14
21
问题
设窗体上有一个Command1命令按钮,还有以下程序代码:
Private Sub Command1_Click()
Static x As Integer
x = x + 1
Call proc(x)
Print x,
End Sub
Private Sub proc(a As Integer)
Static x As Integer
x = x + a
a = x
End Sub
程序运行后,3次单击命令按钮,则产生的输出是
选项
A、1 2 3
B、1 3 5
C、1 3 7
D、2 4 6
答案
C
解析
注意Static关键字修饰的变量,在过程退出后,变量值保持不变。选C)。
转载请注明原文地址:https://kaotiyun.com/show/NdFp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
如果要在窗体上画一个标签,应在工具箱窗口中选择的图标是( )。
以下关于变量作用域的叙述中错误的是( )。
软件生命周期可分为定义阶段、开发阶段和维护阶段,下面不属于开发阶段任务的是
窗体上有单选钮和列表框控件。单击名称为Option1、标题为"国家"的单选钮,向列表框中添加国家名称,如下图所示。Option1的单击事件过程如下:PrivateSubOption1_Click() Dimarr arr=Array("
VisualBasic源程序的续行符为
下列叙述中正确的是
窗体上有两个水平滚动条HV、HT,还有一个文本框Text1和一个标题为"计算"的命令按钮Command1,并编写了以下程序:PrivateSubCommand1_Click()Callcalc(HV.Value,HT.Value)EndSu
在考生文件央下有一个工程文件sjt5.vbp,功能是用来计算勾股定理整数组合的个数。勾股定理中3个数的关系是:a2+b2=c2。例如,3、4、5就是一个满足条件的整数组合(注意:a.b,c分别为4,3,5与分别为3,4,5被视为同一个组合,不应该重复计算)
下面对软件测试和软件调试有关概念叙述错误的是
某二叉树中有n个度为2的结点,则该二叉树中的叶子结点数为
随机试题
肾上腺皮质分泌的激素有
成年人标准体型的体表入射剂量规定<30mGy的摄影部位是
简述坚持社会主义基本经济制度的原则。
(2009)下述哪条不是厅堂体形设计的基本设计原则?
在工程结构中,受压杆件如果比较细长,受力达到一定的数值(一般未达到强度破坏)时,杆件突然发生弯曲,以致引起整个结构的破坏,这种现象称为()。
网上银行的特征有()。
银行业金融机构应至少每()年开展一次绿色信贷的全面评估工作,并向银行业监;机构报送自我评估报告。
“勤励尽职”要求银行业从业人员做到()。
当一项长期投资方案的净现值大于0时,说明()。
设总体X的概率分布如下表所示其中θ(0
最新回复
(
0
)