Results 1 to 2 of 2

Thread: Collections -> How to add a new item after a 'group' of strings?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2003
    Posts
    1,269

    Collections -> How to add a new item after a 'group' of strings?

    in a collection, ive got something like
    KEYWORD lots of data
    KEYWORD lots of data
    KEYWORD lots of data
    KEYWORD #lots of data
    KEYWORD #lots of data
    KEYWORD #lots of data
    KEYWORD #lots of data
    KEYWORD #lots of data

    lots of data is variable

    how can i add a new item after all the 'KEYWORD lots of data'? (or immideately before 'KEYWORD #lots of data')

    anyone know?

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Read through the collection, find the sequence number of the last "KEYWORD lots of data" and then

    VB Code:
    1. MyCollection.Add SomeItem, ItsKey, After:=SequenceNumber

    In your example data, SequenceNumber would be 3. In other situations you can use Before:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width