當前位置:成語大全網 - 新華字典 - VB中,中斷程序怎麽寫?

VB中,中斷程序怎麽寫?

代碼如下:

 n = Val(T1.Text) '接收用戶的數字

s = ""

For i = 0 To n - 1

s = s + "0"

Next i '不足的補0

i = 0

If number Then

If n < "47" And n > "58" Or n = 0 Then

tishi = MsgBox("在這只能輸入整數,不能是字母或字符!", , "出錯")

ElseIf n >= 3 Then

hh = MsgBox("妳輸入的位數過大,妳是否真的要繼續?", 49, "提示")

If hh = 1 Then

Open App.Path & "\字典.txt" For Append As #235

exit1.Caption = "取消"

While j <= n '判斷變量i與n的長度來決定循環的中止

a = Format(i, s)

Print #235, a

i = i + 1

j = Len(i)

Wend

Set Form = Nothing

shi = MsgBox("字典成功生成!", , "提示")

Close #235

T1.Text = ""

T1.SetFocus

exit1.Caption = "退出"

Else

Close #235

End If

Else

Open App.Path & "\字典.txt" For Append As #235

exit1.Caption = "取消"

While j <= n

a = Format(i, s)

Print #235, a

i = i + 1

j = Len(i)

Wend

Set Form = Nothing

shi = MsgBox("字典成功生成!", , "提示")

Close #235

T1.Text = ""

T1.SetFocus

exit1.Caption = "退出"

End If

想在這裏加壹個中斷while的程序。。用另壹個按鈕來控制