万能百科  > 计算机   > 

[单项选择题] 设有如下通用过程:Public Function Fun(xStr As String)As StringDim tStr As String,

2021-07-20   

[单项选择题] 设有如下通用过程:Public Function Fun(xStr As String)As StringDim tStr As String,strL As IntegerstrL=Len(xStr)Do While i

A.ABCDEF

B.abcdef

C.AFBECD

D.DEFABC

正确答案:

C

参考解析:

Function过程也叫函数过程,一般用于调用后不仅要执行一组代码完成相应操作,还需返回一个有用值的情况。Function函数的参数有两种传递方式:按值传递(Byval)和按址传递(Byref),默认为按址传递。调用Function函数常放在在赋值符右端。D0 While为当型循环,在本题程序中它的作用是:依次从字符串变量xstrr的首尾分别向字符串中间取出一个字符,然后组成一个新字符串。循环过程为: 当i=1时,tstr="af"; 当i=2时,tstr="afbe"; 当i=3时,=tstr="afbecd"; 转换为大写后,在文本框中显示为"AFBECD"

词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。

标签