hatechange 发表于 2007-1-18 14:17:00

do loop 怎么利用按键退出啊!

do
set text=thisdrawing.modelspace.addtext(1,1,1)
if按esc键 then
exit do
end if
loop
大虾救命啊!!!!!!!!!!!!!!!!!!!!!!

egua 发表于 2007-1-18 14:31:00

貌似不可以~

wyj7485 发表于 2007-1-18 15:57:00

用API就可以
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Const VK_ESCAPE = &H1B
If GetAsyncKeyState(VK_ESCAPE) Then
Exit do
End If

hatechange 发表于 2007-1-22 17:18:00

大虾,小弟愚笨,还是有些不明。能否进一步赐教。

wyj7485 发表于 2007-1-22 17:45:00

'API声明
Private Declare Function GetAsyncKeyState Lib "user32"
                (ByVal vKey As Long)
                As Integer
Private Const VK_ESCAPE = &H1B'按下ESC键
'放到要退出语句处
If GetAsyncKeyState(VK_ESCAPE)
                Then'判断是否按下ESC键
Exit
                do
End
                If
’代替语句
if按esc键 then
exit do
end if
页: [1]
查看完整版本: do loop 怎么利用按键退出啊!