baneit319 发表于 2015-6-14 15:56:24

自定义函数里面 数组怎么用?

请问自定义函数里面数组怎么用?我如下一定义数组就出错.
Function moveletter(ByVal items As AcadEntity, ByVal st As String, Byval point1( 0 to 2 ) As Double, Byval point2( 0 to 2 ) As Double)
    Dim kk As AcadEntity
    Set kk = items.Copy
      kk.Move point1, point2
      kk.Layer = st
End Function

zzyong00 发表于 2015-6-14 22:42:20

Byval point1( 0 to 2 ) As Double, Byval point2( 0 to 2 ) As Double
改为point1( 0 to 2 ) As Double, point2( 0 to 2 ) As Double
也就是byref

baneit319 发表于 2015-6-15 14:51:55

zzyong00 发表于 2015-6-14 22:42 static/image/common/back.gif
Byval point1( 0 to 2 ) As Double, Byval point2( 0 to 2 ) As Double
改为point1( 0 to 2 ) As Double,...

我改了point1(0 to 2) as double也不行,但是改成point1() 它就行了,很神奇

我还有梦想 发表于 2015-7-28 18:05:08

变量定义错误,仔细看看,数据类型搭配错误.
页: [1]
查看完整版本: 自定义函数里面 数组怎么用?