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

无效的过程调用或参数

<p>Sub cccc() '测试函数<br/>'Private Type Point '三维点<br/>&nbsp;&nbsp; ' X As Single<br/>&nbsp;&nbsp; ' Y As Single<br/>&nbsp;&nbsp;&nbsp; 'H As Single<br/>'End Type</p><p>'Dim sqm() As Double<br/>Dim line As AcadLine<br/>Dim s(0 To 2) As Double<br/>'Dim e(0 To 2) As Double<br/>Dim s1() As Variant<br/>Dim e1() As Variant<br/>Dim x As Variant<br/>Dim y As Variant<br/>Dim h As Variant<br/>Dim PI As Double</p><p>PI = 3.1415926</p><p>&nbsp;&nbsp;&nbsp; Dim d As Double<br/>&nbsp;&nbsp;&nbsp; Dim t As Double<br/>&nbsp;&nbsp;&nbsp; Dim l As Double<br/>&nbsp;&nbsp;&nbsp; Dim r As Double<br/>&nbsp;&nbsp;&nbsp; Dim d1 As Double<br/>&nbsp;&nbsp;&nbsp; Dim e As Double<br/>&nbsp;&nbsp;&nbsp; Dim f As Double<br/>&nbsp;&nbsp;&nbsp; Dim m As Double<br/>&nbsp;&nbsp;&nbsp; Dim n2 As Double<br/>&nbsp;&nbsp;&nbsp; Dim n As Double<br/>&nbsp;&nbsp;&nbsp; Dim c1 As Double<br/>&nbsp;&nbsp;&nbsp; Dim c2 As Double<br/>&nbsp;&nbsp;&nbsp; Dim c3 As Double<br/>&nbsp;&nbsp;&nbsp; Dim c4 As Double<br/>&nbsp;&nbsp;&nbsp; Dim c5 As Double<br/>&nbsp;&nbsp;&nbsp; Dim c As Double<br/>&nbsp;&nbsp;&nbsp; Dim a As Double<br/>&nbsp;&nbsp;&nbsp; Dim b As Double<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; Dim DD As Double<br/>&nbsp;&nbsp;&nbsp; Dim g As Double<br/>&nbsp;&nbsp;&nbsp; Dim m1 As Double<br/>&nbsp;&nbsp;&nbsp; Dim n1 As Double<br/>&nbsp;&nbsp;&nbsp; Dim w As Double<br/>&nbsp;&nbsp;&nbsp; Dim p As Double<br/>&nbsp;&nbsp;&nbsp; Dim q As Double<br/>&nbsp;&nbsp;&nbsp; 'Dim sqm1 As Variant<br/>&nbsp;&nbsp;&nbsp; Dim sqm1(0 To 2) As Double<br/>&nbsp;&nbsp;&nbsp; Dim sqm(0 To 2) As Double<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; x = 144.005: y = -14: h = 1076<br/>&nbsp;&nbsp;&nbsp; a = 29: b = 2<br/>&nbsp;&nbsp;&nbsp; c4 = (a - b) ^ (1 / 3)<br/>&nbsp;&nbsp;&nbsp; c5 = 1 / 3<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp; If h &lt;= 965 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 950.5<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 73.125 - 0.049 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 34.94 + 3.7538 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 176.262 + 0.2225 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'GoTo zbjs<br/>&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 975 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 970<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 72.207 + 0.0586 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 96.186 + 1.3628 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 180.601 + 0.2224 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'GoTo zbjs<br/>&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 990 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 975<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 72.5 - 0.0086 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 103 + 1.4 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 181.713 + 0.2225 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp; ' GoTo zbjs<br/>&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 1010 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 990<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 72.371 - 0.0086 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 124 + 1.4 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 185.05 + 0.2225 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp; ' GoTo zbjs<br/>&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 1030 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 1010<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 72.2 - 0.105 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 152 + 1.1125 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 189.5 + 0.245 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'GoTo zbjs<br/>&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 1050 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 1030<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 70.1 - 0.105 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 174.25 + 1.1125 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 194.4 + 0.345 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp; ' GoTo zbjs<br/>&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 1070 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 1050<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 68 - 0.145 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 196.5 + 0.8375 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 201.3 + 0.5769 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp; ' GoTo zbjs<br/>&nbsp;&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 1090 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 1070<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 65.1 - 0.145 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 213.25 + 1.1375 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 212.839 + 0.8769 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GoTo zbjs<br/>&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 1110 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 1090<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 62.2 - 0.215 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 236 + 1.225 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 230.377 + 1.27965 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'GoTo zbjs<br/>&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 1130 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 1110<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 57.9 - 0.215 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 260.5 + 1.225 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 255.97 + 1.3297 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp; ' GoTo zbjs<br/>&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 1150 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 1130<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 53.6 - 0.24 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 285 + 1.175 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 282.564 + 1.3258 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp; ' GoTo zbjs<br/>&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 1170 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 1150<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 48.8 - 0.24 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 308.5 + 1.375 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 309.08 + 1.7259 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp; ' GoTo zbjs<br/>&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 1190 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 1170<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 44 - 0.3375 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 336 + 1.073 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 343.597 + 1.5823 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp; ' GoTo zbjs<br/>&nbsp;&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 1210 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 1190<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 37.25 - 0.3375 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 357.46 + 1.073 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 375.243 + 1.7824 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp; ' GoTo zbjs<br/>&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 1230 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 1210<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 30.5 - 0.4143 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 378.92 + 0.588 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 410.89 + 1.6983 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp; ' GoTo zbjs<br/>&nbsp;&nbsp;&nbsp; ElseIf h &lt;= 1245 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = h - 1230<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = 22.214 - 0.4143 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = 390.68 + 0.588 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = 444.856 + 1.9316 * d<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'GoTo zbjs<br/>&nbsp;&nbsp;&nbsp; End If<br/>&nbsp; <br/>zbjs: d1 = 1245 - h</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e = 6 - 0.40342 * d1 + 1.20744 * d1 ^ 2 / 10 ^ 3 + 2.78123 * d1 ^ 3 / 10 ^ 7<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f = 12 + 0.440058 * d1 - 1.16241 * d1 ^ 2 / 10 ^ 3 + 1.2662856 * d1 ^ 3 / 10 ^ 6<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m = -(r ^ 2 * x)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&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.5 * r ^ 2 * Log(c + Sqr(r ^ 2 + c ^ 2)) - 0.5 * r ^ 2 * Log(r)) / r<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; w = f + (t - f) * (n1 / m1) ^ 2.2<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p = c + 0.5 * w * Sin(g)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; q = DD - 0.5 * w * Cos(g)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox c2<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox "x=" &amp; p &amp; " y= " &amp; q<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End Sub</p><p>其中的C2值c2 = (c1 - m) ^&nbsp;1/3&nbsp;提示没问题,但算出来是(c1 - m)/3的结果,若变成c2 = (c1 - m) ^&nbsp;(1/3),老提示无效的过程调用或参数.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p><p>在这里请教各位高手,先行感谢</p>
页: [1]
查看完整版本: 无效的过程调用或参数