📄 resume.frm
字号:
VERSION 5.00
Begin VB.Form imgImage
Caption = "Fig. 13.7: Demonstrating Resume"
ClientHeight = 2415
ClientLeft = 2370
ClientTop = 1485
ClientWidth = 5565
LinkTopic = "Form1"
ScaleHeight = 2415
ScaleWidth = 5565
Begin VB.Frame fraSelection
Caption = "Error Handling Response"
Height = 1575
Left = 2880
TabIndex = 1
Top = 60
Width = 2655
Begin VB.OptionButton optResumeLabel
Caption = "Resume at resumeLabel"
Height = 495
Left = 120
TabIndex = 4
Top = 960
Width = 2055
End
Begin VB.OptionButton optResumeNext
Caption = "Resume Next"
Height = 255
Left = 120
TabIndex = 3
Top = 720
Width = 1455
End
Begin VB.OptionButton optResume
Caption = "Resume"
Height = 495
Left = 135
TabIndex = 2
Top = 240
Value = -1 'True
Width = 1335
End
End
Begin VB.CommandButton cmdGo
Caption = "Go"
Height = 495
Left = 3600
TabIndex = 0
Top = 1785
Width = 1215
End
End
Attribute VB_Name = "imgImage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Fig. 13.7
' Resume example
Option Explicit ' General declaration
Private Sub cmdGo_Click()
Dim x As Integer
Dim s As String
resumeLabel:
s = "Visual Basic How to Program!"
Print s
On Error GoTo handler
' InputBox can raise OverFlow and Type
' mismatch errors
x = InputBox("Enter a integer:", s)
Print "Value of x is " & x
Exit Sub
handler:
If optResume.Value Then
Print "Resume: ";
Resume ' Repeat line that raised error
ElseIf optResumeNext.Value Then
Print "Resume Next: ";
Resume Next ' Resume at next line after error raising line
Else ' optResumeLabel
Print "Label: ";
Resume resumeLabel ' Resume at label resumeLabel
End If
End Sub
Private Sub optResume_Click()
Call Cls
End Sub
Private Sub optResumeLabel_Click()
Call Cls
End Sub
Private Sub optResumeNext_Click()
Call Cls
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -