qiaock1105 发表于 2007-10-31 21:03:00

无效的过程调用或参数

Sub cccc() '测试函数
'Private Type Point '三维点
   ' X As Single
   ' Y As Single
    'H As Single
'End Type
'Dim sqm() As Double
Dim line As AcadLine
Dim s(0 To 2) As Double
'Dim e(0 To 2) As Double
Dim s1() As Variant
Dim e1() As Variant
Dim x As Variant
Dim y As Variant
Dim h As Variant
Dim PI As Double
PI = 3.1415926
    Dim d As Double
    Dim t As Double
    Dim l As Double
    Dim r As Double
    Dim d1 As Double
    Dim e As Double
    Dim f As Double
    Dim m As Double
    Dim n2 As Double
    Dim n As Double
    Dim c1 As Double
    Dim c2 As Double
    Dim c3 As Double
    Dim c4 As Double
    Dim c5 As Double
    Dim c As Double
    Dim a As Double
    Dim b As Double
      
    Dim DD As Double
    Dim g As Double
    Dim m1 As Double
    Dim n1 As Double
    Dim w As Double
    Dim p As Double
    Dim q As Double
    'Dim sqm1 As Variant
    Dim sqm1(0 To 2) As Double
    Dim sqm(0 To 2) As Double
   
    x = 144.005: y = -14: h = 1076
    a = 29: b = 2
    c4 = (a - b) ^ (1 / 3)
    c5 = 1 / 3
      
If h
      e = 6 - 0.40342 * d1 + 1.20744 * d1 ^ 2 / 10 ^ 3 + 2.78123 * d1 ^ 3 / 10 ^ 7
      
      f = 12 + 0.440058 * d1 - 1.16241 * d1 ^ 2 / 10 ^ 3 + 1.2662856 * d1 ^ 3 / 10 ^ 6
      
      m = -(r ^ 2 * x)
      
      n2 = e + r - y
      
      n = 2 * r * n2 / 3
      
       c1 = Sqr(m ^ 2 + n ^ 3)
      
      c2 = (c1 - m) ^ 1/3      
      c3 = (-c1 - m) ^ 1 / 3
      
      c = c2 + c3
            
         DD = e + (1 / 2) * c ^ 2 / r
      
         g = Atn(c / r) '* 180 / pi
      
      m1 = (0.5 * l * (Sqr(r ^ 2 + l ^ 2)) + 0.5 * r ^ 2 * Log(l + Sqr(r ^ 2 + l ^ 2)) - 0.5 * r ^ 2 * Log(r)) / r
      
      n1 = (0.5 * c * (Sqr(r ^ 2 + c ^ 2)) + 0.5 * r ^ 2 * Log(c + Sqr(r ^ 2 + c ^ 2)) - 0.5 * r ^ 2 * Log(r)) / r
      
      w = f + (t - f) * (n1 / m1) ^ 2.2
      
      p = c + 0.5 * w * Sin(g)
      
      q = DD - 0.5 * w * Cos(g)
      
      MsgBox c2
      
      MsgBox "x=" & p & " y= " & q
      
      
   End Sub
其中的C2值c2 = (c1 - m) ^ 1/3 提示没问题,但算出来是(c1 - m)/3的结果,若变成c2 = (c1 - m) ^ (1/3),老提示无效的过程调用或参数.            
在这里请教各位高手,先行感谢
页: [1]
查看完整版本: 无效的过程调用或参数