I'm getting an index out IndexOutOfRange Exception, here is my code in vb6:
Public Function GetDelimitedWord(ByVal pvstrInput As String, _
ByVal pvintItem As Integer, _
ByVal pvstrDelim As String) As String
Const lcstrPROC_NAME As String = "GetDelimitedWord"
Dim lvintCounter As Integer
Dim lvintNewStartPos As Integer
Dim lvintStartPos As Integer
Dim lvintEndPos As Integer
On Error GoTo ErrorHandler
lvintCounter = 1
lvintStartPos = 1
For lvintCounter = 2 To pvintItem
lvintNewSt