Re: stupid question
- From: "Todd Vargo" <tlvargo@xxxxxxxxxxxxxx>
- Date: Sat, 10 May 2008 00:54:54 -0400
preet wrote:
Actually these names of folders
i have a menu script and i wish to avoid certain files and certain
folders from being displayed in the script
so for comparision we take them as pure names nothing else
no binary comparisons
since i presume the number of files or folders to be ignored will be
huge, i wish to avoid multiple AND
and put <> (comp1, comp2, comp3, comp4)
this is what i wish to find out
Assuming you have the list of files stored in an array, you could loop
through them and set a Boolean flag if the name is found.
'Create a demo list in MyArray
Dim MyArray(2)
MyArray(0) = "zero"
MyArray(1) = "one"
MyArray(2) = "two"
name = "foo" 'Name to find
found = false 'initialize flag
For i = Lbound(MyArray) To Ubound(MyArray)
If Ucase(name) = Ucase(MyArray(i)) Then
found = true 'item was found so toggle flag
Exit For 'and abort the search
End If
Next
If found Then 'report status
msgbox name & " was found in list.",,"Found"
Else
msgbox name & " was NOT found in list.",,"NOT Found"
End If
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
.
- Follow-Ups:
- Re: stupid question
- From: preet
- Re: stupid question
- References:
- Re: stupid question
- From: mayayana
- Re: stupid question
- From: preet
- Re: stupid question
- Prev by Date: Re: stupid question
- Next by Date: Re: stupid question
- Previous by thread: Re: stupid question
- Next by thread: Re: stupid question
- Index(es):
Relevant Pages
|