?? code109a.txt
字號:
Option Compare Binary
Public Function Part_String_Compare(ByVal String1 As String, _
ByVal String2 As String, ByVal NumChars As Integer) As Integer
If Left(String1, NumChars) < Left(String2, NumChars) Then _
Part_String_Compare = 1
If Left(String1, NumChars) > Left(String2, NumChars) Then _
Part_String_Compare = -1
If Left(String1, NumChars) = Left(String2, NumChars) Then _
Part_String_Compare = 0
End Function
Public Sub Main()
Debug.Print "Comparing 3 letters Abcde with Abcde", _
Part_String_Compare("Abcde", "Abcde", 3)
Debug.Print "Comparing 3 letters abcde with Abcdf", _
Part_String_Compare("abcde", "Abcdf", 3)
Debug.Print "Comparing 4 letters abcd with abcde", _
Part_String_Compare("abcd", "abcde", 4)
Debug.Print "Comparing 4 letters Abc with Abcd", _
Part_String_Compare("Abc", "Abcd", 4)
Debug.Print "Comparing 5 letters abcdefg with abcefgh", _
Part_String_Compare("abcdefgh", "abcefgh", 5)
Debug.Print "Comparing 6 letters AbcdeFG with Abcdefg", _
Part_String_Compare("AbcdeFG", "Abcdedfg", 6)
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -