Logical operators: And, Or, Xor, Eqv, Imp, Not

Logical Operator Function
val1 And val2

val1 Or val2

val1 Xor val2

val1 Eqv val2

val1 Imp val2

Not val

True if both are true

True if one or both are true

True if only one is true

True if both are true or both are false

True if val2 is true or both are false

True if val is false

Example Code Result
<%
V1=10
V2=20
V3=30
if V1<V2 AND V2<V3 then
response.write ("Correct order") 
else
response.write ("Incorrect order") 
end if
%>
Correct order
<%
V1=10
V2=20
V3=30
if NOT V1>V2 AND V2<V3 then
response.write ("Correct order") 
else
response.write ("Incorrect order") 
end if
%>
Correct order

 

AspTutorial.info.