首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设有如下通用过程: Public Function Fun(x Str As String)As String Dim tStr As String,strL As Integer tStr=”” strL=Le
设有如下通用过程: Public Function Fun(x Str As String)As String Dim tStr As String,strL As Integer tStr=”” strL=Le
admin
2019-07-30
6
问题
设有如下通用过程:
Public Function Fun(x Str As String)As String
Dim tStr As String,strL As Integer tStr=””
strL=Len(xStr)i=1
DO While i<=strL/2
tStr=tStr&Mid(xStr,i,1)&Mid(xStr,strL-i+1,1)
i=i+1
Loop
Fun=tStr
End Function
在窗体上画一个名称为Commandl的命令按钮。然后编写如下的事件过程:
Private Sub Commandl_Click()
Dim S1 As String
S1=”abcdef”:Print UCase(Fun(S1))
End Sub
程序运行后,单击命令按钮,输出结果是
选项
A、ABCDEF
B、abcdef
C、AFBECD
D、DEFABC
答案
C
解析
本题通用过程的功能是:从字符串变量xStr值的左右两端同时开始,由外向里每次取出两个字符(左右各一个),组成一个新的字符串。
本题程序运行后,当调用通用过程函数Fun后,返回值应为“afbecd”,转换为大写后在文本框中的显示结果为“AFBECD”。
转载请注明原文地址:https://kaotiyun.com/show/NeUp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
假定建立了一个名为Command1的命令按钮数组,则以下说法中错误的是
设有如下通用过程:PublicFunctionf(xAsInteger)DimyAsIntegerx=20:y=2:f=x*yEndFunction在窗体上画一个命令按钮,其名称为Comma
设有如下语句:Dima,bAsIntegerc="VisualBasic"d=#7/20/2005#以下关于这段代码的叙述中,错误的是
向文本框中输入字符时,下面能够被触发的事件是
以下关于键盘事件的叙述中,错误的是
以下关于窗体的叙述中,错误的是
假定一个工程由一个窗体文件Form1和两个标准模块文件Model1和Model2组成Model1的代码如下:PublicxAsInteger:PublicyAsIntegerSubS1()
下列可作为VisualBasic变量名的是
为使文本框具有初始值“VB”,在设计阶段正确的操作是
列表框中的项目保存在一个数组中,这个数组的名字是
随机试题
A.低钾血症B.等渗性缺水C.高渗性缺水D.低渗性缺水E.低钙血症胰、十二指肠切除术后,持续胃肠减压2周,无排气,腹部无压痛,肠鸣音减弱,T波低平,考虑存在
新铣床验收工作应按__________进行。
教育心理学的创始人是_______。
关于乳腺粉刺癌的叙述,正确的是
改善LES功能状态宜选用
某冰箱生产企业为应对市场竞争,近年来一直以降低产品销售价格为主要竞争策略。为了改善经营业绩,该企业拟调整竞争策略,并为此聘请一家咨询公司对当地冰箱市场进行分析。咨询公司从委托单位得到了部分资料(见表1-1)。咨询公司决定采用德尔菲法开展工作,对
下列关于商用房贷款担保方式说法,错误的是()。
近期研制出利用玉米叶片加工、编织购物袋的技术。这种购物袋易分解且物美价廉。不同的工业部门生产特点不同。工业区位选择考虑的主导区位因素也不同。把接近消费市场作为主导区位因素的工厂是()。’
将十六进制数9B转换为八进制数为(1)。
PatentPatents【T1】______thechancesofinventorstomakemoneyfrom【T2】______.【T3】_______youhaveanidea【T4】______.Howdo
最新回复
(
0
)