frmexsub.frm
来自「Visual Basic 6 大学教程的代码」· FRM 代码 · 共 61 行
FRM
61 行
VERSION 5.00
Begin VB.Form frmExSub
Caption = "Fig. 6.13: Demonstrating Exit Sub"
ClientHeight = 3300
ClientLeft = 3120
ClientTop = 1710
ClientWidth = 4185
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
LinkTopic = "Form1"
PaletteMode = 1 'UseZOrder
ScaleHeight = 3300
ScaleWidth = 4185
Begin VB.CommandButton cmdBegin
BackColor = &H80000005&
Caption = "Print"
Height = 615
Left = 1305
TabIndex = 0
Top = 2520
Width = 1575
End
End
Attribute VB_Name = "frmExSub"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Fig. 6.13
' Demonstrating Exit Sub
Option Explicit ' General declaration
Private Sub cmdBegin_Click()
Dim x As Integer
For x = 5 To -1 Step -1
Call PrintNumbers(x)
Next x
cmdBegin.Enabled = False
End Sub
Private Sub PrintNumbers(number As Integer)
If number >= 0 Then
Print number
Else
Print "Exiting Sub with number = " & number
Exit Sub ' Exit procedure
End If
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?