陈琦 发表于 2007-4-5 06:47:00

whilie...wend循环的跳出

<p>While Not finished<br/>point3D = ThisDrawing.Utility.GetPoint(, "click on next point or red circle to finish!")<br/>If Sqr(point3D(0) ^ 2 + point3D(1) ^ 2 + point3D(2) ^ 2) &lt; circleradius Then<br/>finshed = True<br/>outercircle(0).Delete<br/>ThisDrawing.Regen acActiveViewport<br/>Else<br/>numberofelements = numberofelements + 3<br/>ReDim Preserve polyarray(0 To numberofelements)<br/>polyarray(numberofelements - 2) = point3D(0)<br/>polyarray(numberofelements - 1) = point3D(1)<br/>polyarray(numberofelements) = point3D(2)<br/>Set newpoint = ThisDrawing.ModelSpace.AddPoint(point3D)<br/>If numberofelements &gt; 2 Then redrawpolyline<br/>End If<br/>Wend</p><p>各位高手,这是绘制图形并填充图形VBA代码的一部分,小弟通过逐步调试发现程序无法跳出该循环,请教各位高手WHILE。。。WEND语句怎样在符合条件后跳出!</p>

wyj7485 发表于 2007-4-5 14:10:00

在要跳出该循环的地方finshed = False

lafare 发表于 2007-4-15 00:34:00

我更喜欢Do~~~~~~~Loop循环,在循环中使用Exit Do即可跳出。

crazylsp 发表于 2012-10-9 10:28:40

准确地说是退出当前循环的。
页: [1]
查看完整版本: whilie...wend循环的跳出