Monday, October 27, 2008

LotusScript equivalents for the @Explode

Function Explode(Byval sInput As String, Byval sDelimiter As String) As Variant 
'LotusScript equivalents for the @Explode
Dim sOutput As String 
Dim aOutput() As String 
Dim nPos As Integer 
Dim nNextPos As Integer 
sOutput = sInput     
Redim aOutput(0)     
nPos = Instr(sOutput, sDelimiter) 
While nPos <> 0 
aOutput(Ubound(aOutput)) = Left(sOutput, nPos - 1) 
sOutput = Right(sOutput, Len(sOutput) - Len(sDelimiter) - nPos + 1) 
nPos = Instr(sOutput, sDelimiter) 
Redim Preserve aOutput(Ubound(aOutput) + 1) 
Wend 
aOutput(Ubound(aOutput)) = sOutput     
Explode = aOutput 
End Function 

No comments: