Function LSConcat(vla As Variant, vlb As Variant, debugmode As String) As Variant
' concatenates one list to another, if error returns an empty list
Dim ComboLst() As String ' object to get both lists
Dim counter As Integer ' counter for lists
On Error Goto FErrorHandler
Redim ComboLst(0)
counter = 0
Forall listmember In vla
Redim Preserve ComboLst(counter)
ComboLst(counter)=Cstr(listmember)
counter = counter + 1
End Forall
Forall listmember In vlb
Redim Preserve ComboLst(counter)
ComboLst(counter)=Cstr(listmember)
counter = counter + 1
End Forall
FExit:
LSConcat = ComboLst()
Exit Function
FErrorHandler:
If (debugmode="1") Then
Print "(LSConcat) Unexpected error: " & Error$ & " (" & Cstr(Err) & "), on line: " & Cstr(Erl)
End If
Redim ComboLst(0)
ComboLst(0)=""
Resume FExit
End Function
previous page
|