Comparison operators: =, <>, >, >=, <, <=

In order to perform comparations, lets define some variables:
<%
V1=10
V2=10
%>
The variables may be string in order to perform the comparations bellow.
= (equal)
<% 
if V1=V2 then
response.write ("Response1") 
else
response.write ("Response2") 
end if
%>
Response1
<> (different)
<% 
if V1<>V2 then
response.write ("Response1") 
else
response.write ("Response2") 
end if
%>
Response2
> (greater than)
<% 
if V1>V2 then
response.write ("Response1") 
else
response.write ("Response2") 
end if
%>
Response2
>= (greater or equal)
<% 
if V1>=V2 then
response.write ("Response1") 
else
response.write ("Response2") 
end if
%>
Response1
< (less than)
<% 
if V1<V2 then
response.write ("Response1") 
else
response.write ("Response2") 
end if
%>
Response2
<= (less or equal)
<% 
if V1>=V2 then
response.write ("Response1") 
else
response.write ("Response2") 
end if
%>
Response1

 

AspTutorial.info.