LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default VBA - array or collection literals?

Currently, I have written a function to do some sort of pattern
matching:

Dim delims As New Collection
delims.Add " <"
delims.Add "@"
delims.Add ""

Dim tokens As Collection
tokens = UnDelimit("Marcus Schöneborn ", delims)
? tokens.Count ' 4
? tokens(1) ' "Marcus Schöneborn"
? tokens(2) ' "divZero"
? tokens(3) ' "googlemail.com"
? tokens(4) ' ""

Is there a simpler way to call this by making a "literal" collection,
think of it like

Dim tokens As Collection
tokens = UnDelimit("...", {" <", "@", ""})

Or is there a way to get C-like function varargs, so I can use it like

Dim tokens As Collection
tokens = UnDelimit("...", " <", "@", "")

Or, alternatively: is there a way to make the VBScript.RegExp object
support . matching newlines?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 1004 when setting a Series Collection.Values as Array via VB David Messenger Excel Programming 6 July 8th 07 10:59 AM
Collection vs. Array of Arrays, nszim Neal Zimm[_2_] Excel Programming 13 February 6th 06 02:36 PM
VSTO: Sheets collection a 1-based array(?!?!?) Bob Sullentrup Excel Programming 0 November 10th 05 04:10 PM
Writing to An Array or Collection vqthomf Excel Programming 4 August 23rd 05 02:07 PM
Counting literals in cells Joeyej Excel Programming 1 October 8th 04 01:01 AM


All times are GMT +1. The time now is 01:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"