看板Programming
标 题Re: [问题] 请问vb在执行中 停止的指令?
发信站中山计中美丽之岛 (Thu Mar 29 17:58:12 2007)
转信站ptt!ctu-reader!ctu-gate!news.nctu!news.nsysu!Formosa
> ==> [email protected] (㊣shaggy-croco story XD) 的文章中提到:
> ※ 引述《[email protected] (空空)》之铭言:
> > 请问
> > 想要在执行中的程式 当出现case1的时候 跳出 重新再输入 再重跑
> > 还有出现case2时 停在那瞬间
> for回圈中用exit for跳出, while中用exit while
> 用一个变数记录接到的是哪个状态
> 然後在回圈後面用select case或if...else接变数处理
> 例如
> while (1)
> ...
> ...
> if (case1) then breakstate=1: exit while
> if (case2) then breakstate=2: exit while
> ...
> ...
> end while
> select case breakstate
> case 1:
> '(REENTER)
> case 2:
> '(do nothing; halts)
> case else
> end select
>
利用选择结构或是Goto
毕竟VB不是JAVA
--
* Origin: 中山大学-美丽之岛BBS * From: 59.104.47.124