⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comparedates.txt

📁 一部分关于VB编程的小技巧
💻 TXT
字号:
'Comparedates "3/24/01", "3/22/01"
'will return true because the first date
'is after the 2nd
'
Function Comparedates(a As String, B As String) As Boolean
Comparedates = False
Dim Now_Day As Integer
Dim Now_Month As Integer
Dim Now_Year As Integer

Dim Then_Day As Integer
Dim Then_Month As Integer
Dim Then_Year As Integer
Dim i(1) As Integer

i(0) = 1
i(0) = InStr(i(0), a, "/")

Now_Month = Left(a, i(0) - 1)
i(1) = InStr(i(0) + 1, a, "/")
Now_Day = Mid(a, i(0) + 1, i(1) - i(0) - 1)
Now_Year = Right(a, Len(a) - i(1))

i(0) = 1
i(0) = InStr(i(0), B, "/")

Then_Month = Left(B, i(0) - 1)
i(1) = InStr(i(0) + 1, B, "/")
Then_Day = Mid(B, i(0) + 1, i(1) - i(0) - 1)
Then_Year = Right(B, Len(B) - i(1))


If Now_Year > Then_Year Or Now_Month > Then_Month Then Comparedates = True
If Now_Month = Then_Month And Now_Day > Then_Day Then Comparedates = True
End Function

⌨️ 快捷键说明

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