[单项选择题] 设有以下函数过程Private Function Fun(a()As Integer,b As String)As IntegerEnd Function若已有变量声明:

[单项选择题] 设有以下函数过程Private Function Fun(a()As Integer,b As String)As IntegerEnd Function若已有变量声明:,第1张

[单项选择题] 设有以下函数过程 Private Function Fun(a()As Integer,b As String)As Integer End Function 若已有变量声明:

[单项选择题] 设有以下函数过程

Private Function Fun(a()As Integer,b As String)As Integer

End Function

若已有变量声明:

Dim x(5)As Integer,n As Integer,ch As String

则下面正确的过程调用语句是( )。

A.x(0)=Fun(x,"ch")

B.n=Fun(n,ch)

C.Call Fun x,"ch"

D.n=Fun(x(5),c

正确答案:

A

参考解析:

在过程定义时如果将其形参定义为数组,则存调用该过程时所赋予的对应实参必须为数组名,而不能是普通变量、数组元素等。Sub子过程可以使用Call关键字来调用,但是Function函数过程不可以使用Call关键字调用,同时函数过程有一个返回值,可以将其赋值给其他变量或名数组元素。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5584082.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-15
下一篇2022-12-14

发表评论

登录后才能评论

评论列表(0条)

    保存