开发者

How to do multiple conditions for single If statement

开发者 https://www.devze.com 2023-04-06 10:07 出处:网络
I\'m trying to do two conditions on a single If statement in vbscript.Should be really simple, but it\'s not working.Something like:

I'm trying to do two conditions on a single If statement in vbscript. Should be really simple, but it's not working. Something like:

 If Not (fileName = test开发者_JS百科FileName) & (fileName <> "") Then
Else ....

I'm making it two if statements to get it working, but can I do a not conditional with an "and" with another not condition?


Use the 'And' keyword for a logical and. Like this:

If Not ((filename = testFileName) And (fileName <> "")) Then


As Hogan notes above, use an AND instead of &. See this tutorial for more info.

0

精彩评论

暂无评论...
验证码 换一张
取 消