Wildcard With Multi Dim Array????

# Thread: Wildcard With Multi Dim Array????

1. Senior Member
Join Date
Dec 1969
Posts
667

## Wildcard With Multi Dim Array????

Dim MultiDimArray(100,3), CompareVar<BR><BR>If ComparVar = MultiDimArray(*,2) Then<BR>&#039;&#039;&#039;&#039;&#039;&#039;&#039; &#039;&#039;<BR>End If<BR><BR>Is there syntax that can make this work?<BR><BR>thanks in advance

2. Senior Member
Join Date
Dec 1969
Posts
11,334

## Do you mean a variable?

i = 32<BR><BR>If ComparVar = MultiDimArray(i, 2) Then

3. Senior Member
Join Date
Dec 1969
Posts
667

## no, a wildcard

that the value of MultiDim(5,2) = "netscapesucks"<BR><BR>And I want to ComparVar to see if it equals MultiDim(5,2). But I don&#039;t know it&#039;s (5,2) I only know its (somenumber,2)<BR> <BR>I can loop for this but i would think that the array could do that for me.

4. Senior Member
Join Date
Dec 1969
Posts
11,334

## No, you have to do it manually

How will the array know what you want?<BR><BR>The array can&#039;t do anything for you. Ya have to write a loop.

5. Senior Member
Join Date
Dec 1969
Posts
96,118

## No...not in VBS...

...and not in most "algorithmic" languages. C/C++/Java/JavaScript/VB/Pascal/PL1 ... none of them support that.<BR><BR>Easy enough to write a function that will, of course.<BR><BR>Or write a Class that wraps the array and has a method that does it...but that&#039;s just another way of saying "write a function."<BR><BR>

6. Senior Member
Join Date
Dec 1969
Posts
667

## Loopy Functions Then : )

&nbsp;<BR>

7. Senior Member
Join Date
Dec 1969
Posts
96,118

## Are you asking us to write one?

??? <BR><BR>For i = 0 To UBound( theArray, 1 )<BR>&nbsp; &nbsp; If whatever = theArray( i, SOME_CONSTANT ) Then<BR>&nbsp; &nbsp; &nbsp; &nbsp; ...<BR>&nbsp; &nbsp; &nbsp; &nbsp; Exit For<BR>&nbsp; &nbsp; End If <BR>Next<BR><BR>Surely you didn&#039;t need help doing that, though? What are you asking?<BR><BR>

#### Posting Permissions

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