code185a.txt

来自「VB大全(精华版)源代码」· 文本 代码 · 共 18 行

TXT
18
字号
Public Function Min(ByVal First, ByVal Second) As Variant
  If First < Second Then Min = First
  If First = Second Then Min = Null
  If Second < First Then Min = Second
End Function

Public Function Max(ByVal First, ByVal Second) As Variant
  If First > Second Then Max = First
  If First = Second Then Max = Null
  If Second > First Then Max = Second
End Function

Public Sub Main()
  Debug.Print "Maximum of 10.0 and 25.0 is ", Max(10.0, 25.0)
  Debug.Print "Minimum of 10.0 and 25.0 is ", Min(10.0, 25.0)
  Debug.Print "Minimum of 10 and 10 is ", Min(10#,10#)
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?