首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设有如下通用过程: Public Function Fun(xStr As String)As String Dim tSt]r As String.strL As Integer tStr="" strL=Len(xStr)i=1
设有如下通用过程: Public Function Fun(xStr As String)As String Dim tSt]r As String.strL As Integer tStr="" strL=Len(xStr)i=1
admin
2019-03-08
19
问题
设有如下通用过程:
Public Function Fun(xStr As String)As String
Dim tSt]r 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
在窗体上画一个名称为Command1的命令按钮。然后编写如下的事件过程:
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/I4Fp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
(1)考生文件夹下有一个工程文件sjt3.vbp,其中的窗体上有一个命令按钮控件数组,名称为Cmd;有一个图像框,名称为Image1。请添加一个名称为Timer1的计时器,时间间隔为3秒,初始状态为不可用,如图所示。程序功能如下:①单击
编写如下程序:PrivateSubCommand1_Click()DimxAsInteger,yAsIntegerx=1y=1Doy=x*yIfy>10T
假定有如下程序:PrivateSubForm_Click()Dima(4)AsInteger,b(4)AsIntegerFork=0To2a(k+1)=Val(InputBox("请
在窗体上画一个名称为Text1的文本框和一个名称为Command1的命令按钮,然后编写如下事件过程:PrivateSubCommand1_Click() DimiAsInteger,nAsInteger Fori=0To
在窗体上画一个通用对话框,程序运行中用ShowOpen方法显示"打开"对话框时,希望在该对话框的"文件类型"栏中只显示扩展名为DOC的文件,则在设计阶段应把通用对话框的Filter属性设置为( )。
以下关于控件的叙述中,正确的是
VB中,若没有显式声明变量的数据类型,则默认的类型是
(1)在名称为Form1的窗体上添加一个名称为Shape1的圆角矩形,高、宽分别为1000、2000。请利用属性窗口设置适当的属性以满足下列要求:①圆角矩形中填满绿色(颜色值为:&H0000FF00&或&HFF00&)。②窗体的标题为“
能够用于标识对象名称的属性是( )。
表达式2*3^2+4*2/2+3^2的值是()。
随机试题
静电对电子设备的损害有:隐蔽性、潜在性、___________和复杂性。
一患儿以肠梗阻入院手术,术中医师将膀胱认作囊肿切除,造成患儿尿潴留、排尿功能严重受损。该事件中,医师的行为属
A.药物因素B.性别因素C.给药方法D.生活和饮食习惯E.工作和生活环境胶囊壳染料可引起固定性药疹
运营费用是从估价角度出发的,与会计上的成本费用不同,则下面不属于运营费用的是()。
会计工作岗位,可以一人一岗、一人多岗或者一岗多人。()
根据公司法规定,有限责任公司的股东会在通过一些特别决议时,必须经代表2/3以上表决权的股东通过。下列各项中,哪些决议不需要经代表2/3以上表决权的股东通过()。
关于无领导小组讨论,错误的表述是()。
对于接待规格理解正确的是()。
下列属于国家赔偿范围的是()。
2012年1一11月,我国电子信息产品进出口总额10685亿美元,同比增长4.1%,增速比1—10月提高0.8个百分点。其中,出口6273亿美元,同比增长4.5%,增速比1—10月提高0.6个百分点,占全国外贸出口的33.9%;进口4412亿美元,同比增
最新回复
(
0
)