- Home
·
- String Manipulation
·
- For any one with VB5 and dosn't have the InStrRev function, this is now available InStrEx Will seac
For any one with VB5 and dosn't have the InStrRev function, this is now available InStrEx Will seac
For any one with VB5 and dosn't have the InStrRev function, this is now available InStrEx Will seach a string Backwards, forwards stop at any
API Declarations
Public Const IS_Mode_For = 0
Public Const IS_Mode_Back = 1
Public Const IS_Mode_Number = 2
Rate For any one with VB5 and dosn't have the InStrRev function, this is now available InStrEx Will seac
(1(1 Vote))
Dim Z As Integer
Dim CN As Long, ChrSteping As Integer
Dim ChrFrom As Integer, ChrTo As Integer
'This is an Instr function without using ther VB InStr Function
'The InstrEx function includes the normal start Position,
'Input Main String and input Compair String, also includes
'Modes for Backwards or Forwards Checking and Charictor
'Number is multipul charictors are in the string
CN = ChrNumber
If CN = Null Or CN = 0 Then CN = 1
CN = CN - 1
If IS_Mode = IS_Mode_For Then
ChrSteping = 1
If StartPos = 0 Or StartPos = vbNull Then StartPos = 1
ChrFrom = StartPos
ChrTo = Len(String1)
ElseIf IS_Mode = IS_Mode_Back Then
ChrSteping = -1
If StartPos = 0 Or StartPos = vbNull Then StartPos = Len(String1)
ChrFrom = StartPos
ChrTo = 1
ElseIf IS_Mode = IS_Mode_Number Then
ChrSteping = 1
ChrFrom = 1
ChrTo = Len(String1)
End If
For Z = ChrFrom To ChrTo Step ChrSteping
Str1 = Mid(String1, Z, Len(String2))
If Str1 = String2 Then
If IS_Mode = IS_Mode_Number Then
InStrEx = InStrEx + 1
Else
InStrEx = Z
If CN = 0 Then
Exit Function
Else
CN = CN - 1
End If
End If
End If
Next Z
End Function
For any one with VB5 and dosn't have the InStrRev function, this is now available InStrEx Will seac Comments
No comments yet — be the first to post one!
Post a Comment