首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
窗体中有命令按钮Command1,事件过程如下: Public Function f(x As Integer) As Integer Dim y As Integer x = 20 y = 2 f = x * y End Function
窗体中有命令按钮Command1,事件过程如下: Public Function f(x As Integer) As Integer Dim y As Integer x = 20 y = 2 f = x * y End Function
admin
2021-06-03
15
问题
窗体中有命令按钮Command1,事件过程如下:
Public Function f(x As Integer) As Integer
Dim y As Integer
x = 20
y = 2
f = x * y
End Function
Private Sub Command1_Click()
Dim y As Integer
Static x As Integer
x = 10
y = 5
y = f(x)
Debug.Print x; y
End Sub
运
选项
A、10 5
B、10 40
C、20 5
D、20 40
答案
D
解析
本题考查的是变量的作用域,程序中命令按钮中的x是用static定义的局部静态变量,只在模块的内部使用,过程执行时才可见。当调用f函数时,所求的f函数的值是f函数中x和y的值乘积,即f函数的值是2*20=40,调用f函数后,原命令按钮中x的值被f函数的值覆盖,即x=20,。最后输出x=20,y=40,故答案为D)。
转载请注明原文地址:https://kaotiyun.com/show/IdSp777K
本试题收录于:
二级Access题库NCRE全国计算机二级分类
0
二级Access
NCRE全国计算机二级
相关试题推荐
在设计窗体时,若要求职称字段只能输入“教授”、“副教授”、“讲”"、“助教”和“其他”,则可以使用的控件是
将两个关系拼接成一个新的关系,生成的新关系中包含满足条件的元组,这种操作称为
Access数据库中的表是一个()。
关系数据库管理系统中所谓的关系是指
在代码中定义了一个子过程:SubP(a,b)End.sub下列调用该过程的形式中,正确的是
线性表的链式存储结构与顺序存储结构相比,链式存储结构的优点有()。
下列不属于Access窗体视图是
为窗体或报表的控件设置属性值的正确宏操作命令是
软件生命周期是指
在调试VBA程序时,能自动被查出来的错误是
随机试题
在机械加工工序和热处理工序间流转及存放时,丝杠须垂直倒挂,以免引起丝杠的“自重变形”。()
右旋糖酐的特点
应将投资项目外部条件的可能性和可变性,作为项目()的组成部分进行评估。
科目一经使用,即已经输入凭证后,则不允许修改或删除该科目。()
下列各项中,不受反垄断法规制的是()。
Inan________activity,teachersandlearnersusuallyfocusonusingandproducinglanguagecorrectly.
研制大型飞机投资大、周期长,不确定因素多,是一项极其复杂的系统工程,面临许多风险和困难,任务十分艰巨。要生产安全可靠、具有市场竞争力的大型飞机,并实现产业化,需要我们做许多艰苦细致的工作。作者接下来最有可能强调的是()。
依次填入下列各句横线处的词语,最恰当的一组是()①西湖南线开放,作为原居住于此的居民旧地重游,______想起往事。②在法律面前人人平等,这个“人人”,______包括所有的人,任何人也不得例外。
Inrecentyearsanewfarmingrevolutionhasbegun,onethatinvolvesthe【C1】______oflifeatafundamentallevel—thegene.Th
Youaretowriteinnoless120wordsonthetopicof"WhatdoIdotostayhealthy".YoumaybaseyourcompositionontheChin
最新回复
(
0
)