wunderbares beispeil für ne endlosschleife
ist zwar n bissl viel code, erfüllt aber seinen Zweck
Public Function CSVread(strInput As String, intPos As Integer, strby As String) As String
Dim strCSVInput As String
Dim strTemp As String
Dim intTempPos As Integer
Dim intLoopCount As Integer
strCSVInput = strInput
intLoopCount = 1
If intPos = 1 Then
intTempPos = (InStr(1, strCSVInput, strby) - 1)
strTemp = Left(strCSVInput, intTempPos)
ElseIf intPos > 1 Then
Do
intTempPos = (Len(strCSVInput) - InStr(1, strCSVInput, strby))
strCSVInput = Right(strCSVInput, intTempPos)
intLoopCount = intLoopCount + 1
Loop While intLoopCount < intPos
intTempPos = (InStr(1, strCSVInput, strby) - 1)
If intTempPos > 0 Then
strTemp = Left(strCSVInput, intTempPos)
Else
strTemp = strCSVInput
End If
Else
MsgBox "Error can't find Pos " & intPos
Exit Function
End If
CSVread = strTemp
End Function
Private Sub Form_Load()
MsgBox CSVread("\\sntko4\gte\gtewrk\hsd-cd\S513792-1.jpg", 100, "\")
End
End Sub