设有以下函数过程 Private Function Fun(a()As Integer,b As String) As Integer … End Function 若已有变量声明: Dim x(5)As Integer,n As Integer,ch A

admin2017-03-26  18

问题 设有以下函数过程
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),ch)

答案A

解析 在过程定义时如果将其形参定义为数组,则在调用该过程时所赋予的对应实参必须为数组名,而不能是普通变量、数组元素等。Sub子过程可以使用Call关键字来调用,但是Function函数过程不可以使用Call关键字调用,同时函数过程有一个返回值,可以将其赋值给其他变量或者数组元素。
转载请注明原文地址:https://kaotiyun.com/show/omGp777K
0

最新回复(0)