📄 frmnamedargs.frm
字号:
VERSION 5.00
Begin VB.Form frmNamedArgs
Caption = "Fig. 6.30: Demonstrating Named Arguments"
ClientHeight = 2025
ClientLeft = 2565
ClientTop = 2520
ClientWidth = 5205
LinkTopic = "Form1"
ScaleHeight = 2025
ScaleWidth = 5205
Begin VB.CommandButton cmdPrint
Caption = "Print"
Height = 495
Left = 2040
TabIndex = 0
Top = 1410
Width = 1215
End
End
Attribute VB_Name = "frmNamedArgs"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Fig. 6.30
' Demonstrating named arguments
Option Explicit ' General declaration
Private Sub cmdPrint_Click()
' Invoke display. Argument list is String, Boolean, Long
Call Display(message:="Named Arguments", flag:=True, _
number:=1000000)
' Invoke display2. Give number2 a value.
Call Display2(number2:=2000000)
End Sub
' Note the order of declaration: Boolean, Long, String
Private Sub Display(flag As Boolean, number As Long, _
message As String)
Print "flag is " & flag
Print "number is " & number
Print "message is " & message
End Sub
Private Sub Display2(Optional flag2 As Boolean, _
Optional number2 As Long, _
Optional dollars As Currency)
Print ' Blank line
Print "flag2 is " & flag2
Print "number2 is " & number2
Print "dollars is " & dollars
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -