Another Snippet [AltJoin]

Okay this is my alternative to vb6 join function, this happends when you have nothing to do.

Option Explicit
‘ Function : AltJoin
‘ DateTime : 29.03.2010 22:01PM
‘ Author : Kreshnik Hasanaj
‘ Mail :
‘ Purpose : Alternate Join Function to VB Join Function
‘ Usage : At your own risk
‘ Requirements: None
‘ Distribution: You can freely use this code in your own
‘ applications, but you may not reproduce
‘ or publish this code on any web site,
‘ online service, or distribute as source
‘ on any media without express permission.
Public Function AltJoin(sArray() As String, Optional JoinDelimiter As String) As String
Dim i As Long
Dim sBuffer As String
Dim FinalStr As String

For i = LBound(sArray) To UBound(sArray)
sBuffer = sBuffer & JoinDelimiter & sArray(i)

If Len(JoinDelimiter) = 0 Then
AltJoin = sBuffer
Exit Function

FinalStr = Right$(sBuffer, Len(sBuffer) – 1)
AltJoin = FinalStr
End If

End Function


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s