<gimme_this_gimme_t
...@yahoo.com> wrote in message
news:b1cc3104-0a64-41f1-a956-41655ff3af62@y28g2000prd.googlegroups.com...
> This creates an Array M and fetches the elements having cc - so it
> displays dccr....
> M= Split("bbadccraddaeea","a")
> B = Filter(M,"cc")
> WScript.Echo Join(B,",")
> Filter also has this syntax:
> Filter(Array,Search[,Include[,Mode]])
> Can someone create an example based on these variables that utilizes
> Include?
The Include parameter is a boolean. True (the default), means the new array
will only contain elements of the original that include the Search pattern.
False means the array will contain elements that do not include the Search
pattern. For example, this code:
===============
Option Explicit
Dim M, B, C, D
M = Split("bbadccraddaeea", "a")
Wscript.Echo Join(M, ",")
Wscript.Echo "..."
B = Filter(M, "cc", True)
Wscript.Echo Join(B, ",")
Wscript.Echo "..."
C = Filter(M, "cc", False)
Wscript.Echo Join(C, ",")
Wscript.Echo "..."
D = Filter(M, "cc")
Wscript.Echo Join(D, ",")
========
Results in the following:
bb,dccr,dd,ee,
...
dccr
...
bb,dd,ee,
...
dccr
My reference that describes this function states that the default for
Include is False, but the example above shows this to not be the case. The
default seems to be True.
--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--