Re: Special Character's in a string Compare
- From: "Steven Burn" <somewhere@xxxxxxxxxxxxxxx>
- Date: Fri, 15 Apr 2005 13:47:25 +0100
Watch for line wrap (each Case .. statement should be on one line)
Select Case lcase(strVal)
Case "server.test.com": Wscript.Echo "Value Name: " & arrValueNames(x)&" = " & strVal
Case "server.test.com(1)": Wscript.Echo "Value Name: " & arrValueNames(x)&" = " & strVal
Case Else: Wscript.Echo "Value Name: " & arrValueNames(x)&" = " & strVal
End Select
--
Regards
Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk
Keeping it FREE!
"Yogi_Bear_79" <IThankU@xxxxxxxxxxxx> wrote in message news:v8OdnaVImeunKMLfRVn-3Q@xxxxxxxxxxxxxx
> The below code compares a variable read from a registry string value. It
> works fine except on the ElseIf Stastement. I believe it is because my
> string I am using to compare with has parenthesis in it. I know that there
> is an occurance of this string with parenthesis in it. So my question is,
> how can I write the code to accept them literally or, is there a way to
> reduce this to a single IF statement and use a wildcard?
>
> If strVal = "server.test.com" Then
> Wscript.Echo "Value Name: " & arrValueNames(x)&" = " & strVal
> ElseIf strVal = "server.test.com(1)" Then
> Wscript.Echo "Value Name: " & arrValueNames(x)&" = " & strVal
> End If
>
>
.
- Follow-Ups:
- Re: Special Character's in a string Compare
- From: Yogi_Bear_79
- Re: Special Character's in a string Compare
- References:
- Special Character's in a string Compare
- From: Yogi_Bear_79
- Special Character's in a string Compare
- Prev by Date: Re: WScript.Sleep for HTA?
- Next by Date: Re: Get list of Applicatonnames and Version
- Previous by thread: Special Character's in a string Compare
- Next by thread: Re: Special Character's in a string Compare
- Index(es):
Relevant Pages
|