?? cutils.cls
字號:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "CParseUtils"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'Class name: CParseUtils.cls
Option Explicit
Friend Function CountParts(sString As String, Optional sDelim As String) As Byte
' 返回協議串中用","分割的節數
Dim textPos As Integer
Dim maxPos As Integer
Dim cnt As Integer
If Len(sDelim) = 0 Then sDelim = ","
If Len(sString) = 0 Then
CountParts = 0
Exit Function
End If
textPos = 1
maxPos = Len(sString)
cnt = 0
Do While textPos <= maxPos
If Mid$(sString, textPos, 1) = sDelim Then
cnt = cnt + 1
End If
textPos = textPos + 1
Loop
If cnt = 0 Then
CountParts = cnt
Else
CountParts = cnt + 1
End If
End Function
Friend Function Parse(ByVal sString As String, iReq As Integer, Optional sDelim As String) As String
'分割字符串內容
Dim sSt As String
Dim iCnt As Integer
Dim iPos As Integer
If Len(sDelim) = 0 Then sDelim = ","
sSt = sString & sDelim
For iCnt = 1 To iReq
iPos = InStr(sSt, sDelim)
If iPos Then
If iCnt = iReq Then ' 請求字符串
Parse = Left$(sSt, iPos - 1)
Exit For
End If
If iPos = Len(sSt) Then
Parse = ""
Exit For
End If
sSt = Mid$(sSt, iPos + Len(sDelim))
Else
Parse = sSt
Exit For
End If
Next iCnt
End Function
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -