首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设窗体上有一个Command1命令按钮,还有以下程序代码: Private Sub Command1_Click() Private Sub proc(a As Integer) Static x As Integer Static x As Inte
设窗体上有一个Command1命令按钮,还有以下程序代码: Private Sub Command1_Click() Private Sub proc(a As Integer) Static x As Integer Static x As Inte
admin
2020-04-18
18
问题
设窗体上有一个Command1命令按钮,还有以下程序代码:
Private Sub Command1_Click() Private Sub proc(a As Integer)
Static x As Integer Static x As Integer
x=x+1 x=x+a:a=x
Call proc(x) End Sub
Print x,
End Sub
程序运行后,3次单击命令按钮,则产生的输出是
选项
A、1 2 3
B、1 3 5
C、1 3 7
D、2 4 6
答案
C
解析
本题在Command1 click过程中和Sub过程proc中分别定义了一个静态变量x,这两个x都是局部变量,隶属于不同的局部,互不干涉;当单击命令按钮时,单击事件中的x加1,然后调用proc过程:由于proc的形参a采用地址传递,因此对a的改变会影响实参x。三次单击按钮分别使得两个过程中的x分别交化,都会保留上一次过程结束时的值。
转载请注明原文地址:https://kaotiyun.com/show/0pTp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
设窗体名称为frml。以下叙述中正确的是
为了在FormLoad事件过程中用Print方法在窗体上输出指定的内容,首先应执行的操作是
窗体上有一个名称为Commandl的命令按钮,单击该按钮时所实现的功能是产生10个随机整数,然后从键盘输入一个整数,查找该数在数组中的位置。若找到,输出该数的位置;若没有找到,给出相应的提示。该命令按钮的单击事件过程如下:PrivateSubComm
下面能够将某个变量声明为局部变量的是
设有语句Open“c:\Test.Dat”ForOutputAs#1则以下叙述中错误的是
下列关于滚动条的叙述中,错误的是
使用Line控件在窗体上画一条从(0,0)到(600,700)的直线,则其相应属性的值应是
设窗体上有1个水平滚动条,已经通过属性窗口把它的Max属性设置为1,Min属性设置为100。下面叙述中正确的是
下面说法中错误的是()。
以下说法中正确的是
随机试题
患儿,2岁。发热、流涕、咳嗽已3天,今晨发现前额及耳后有浅红色斑丘疹,眼结膜充血,口腔黏膜粗糙,声音嘶哑,精神萎靡,两肺呼吸音粗。其最可能的诊断是
腹膜炎的主要标志是
丹毒最常见的病原菌是
牙本质、牙髓、牙骨质和牙周膜均来源于
平面区域D:x2+y2≤9,则=()。
当监盘存货受阻时,审计人员应考虑是否存在其他满意的替代程序。()
企业对于已计入“待处理财产损溢”科目的存货盘亏及毁损事项进行会计处理时,应计入营业外支出的是()。
近年来,国内高校每每出现校园安全事故、学术丑闻、师生冲突事件,普遍采取的办法,不是信息公开,坦诚以待,而是尽力________媒体,________认为,只要媒体不报道,就可在内部大事化小,小事化了。而学校宣传部在这一过程中所起的作用,就是想方设法阻止媒体
请以“耐住寂寞,不忘初心”为题,写一篇800字左右的作文。要求:思路清晰,文字通顺,用词得体,结构合理,文笔优美。
攻击者采用某种手段,使用户访问某网站时获得一个其他网站的IP地址,从而将用户的访问引导到其他网站,这种攻击手段称为()。
最新回复
(
0
)