devxlogo

Duplicate the Join Function for VB4 and VB5

Duplicate the Join Function for VB4 and VB5

The native VB6 Split and Join functions have highlighted a number of useful techniques, and VB5 and VB4 programmers can use this extended facility as well. This code emulates the Join function of VB6 for use in earlier versions. This function takes in an array of information and gives a String as output with delimiters per the user request:

 Public Function Join(arr As Variant, Optional _ByVal delimiter) As StringDim sRet As StringDim i As IntegerIf IsArray(arr) ThenIf IsMissing(delimiter) Thendelimiter = " "ElseIf Len(CStr(delimiter)) = 0 Thendelimiter = ""Elsedelimiter = CStr(delimiter)End IfFor i = LBound(arr) To UBound(arr)sRet = sRet & arr(i) & delimiterNext iEnd IfJoin = Left(sRet, Len(sRet) - Len(delimiter))End Function
See also  Professionalism Starts in Your Inbox: Keys to Presenting Your Best Self in Email
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist