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 : kresha7@hotmail.com
‘ 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)
Next

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

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

End Function

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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