[thelist] iteratively comparing to an array with VBScript

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Fri Sep 10 21:16:00 CDT 2004


	There isn't really a way to do that with an array in VBScript...
BUT you can easily convert the array into a string and use that, i.e.

Dim myString
' Make the array into a string; use a delimiter that you 
'  probably won't see in the array elements.
myString = Join(myArray, "|")

For each subfolder in folders
	If InStr(myString, folder.name) > 0 Then
		'do the stuff
	End If
Next


HTH,

Peter

-----Original Message-----
From: thelist-bounces at lists.evolt.org On Behalf Of Joel D Canfield
>
> 	You mean something like
> For Each someSuchThing In TheWhatever
> 
> 	While i < UBound(myArray)
> 
> 		If myArray(i) = someSuchThing Then 
> 			' do the fun stuff
> 			i = UBound(myArray)
> 		End If
> 		i = i + 1
> 	Wend
> Next

Not quite. My pseudo code would be

For each subfolder in folders
	if folder.name is in myArray
		do the stuff
	end if
Next

So, how do I check to see if the current folder.name is in my array of
valid values? Guess that's my question: do I have to loop through the
array each time I check another folder, or is there a simpler way?

joel
-- 

News! - Evolt.org conference for web professionals. 
17-19 September 2004 in Toronto, Canada. 
Details at http://TOevolt.org

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 





More information about the thelist mailing list