dcsimg
May 26, 2018
Hot Topics:

Add the Tokens in a Delimited List to a Collection

  • November 19, 2002
  • By John Dawson
  • Send Email »
  • More Articles »
This routine simply adds each token in a delimited list to a collection:

Public Sub AddListToCollection_(ByRef cCollection As Collection, _List As String, Delimiter As String)    Dim llDelimiterPos As Long    Dim lsWorkingList As String    lsWorkingList = List    llDelimiterPos = InStr(1, lsWorkingList,_       msCOMMA, vbTextCompare)    Do While llDelimiterPos > 0      cCollection.Add Mid$(lsWorkingList, 1,_       llDelimiterPos - 1)      lsWorkingList = Mid$(lsWorkingList,_       llDelimiterPos + 1)      i = i + 1      llDelimiterPos = InStr(1, lsWorkingList,_       msCOMMA, vbTextCompare)    Loop    If Len(lsWorkingList) > 0 Then      cCollection.Add lsWorkingList    End IfEnd Sub






Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date