The if condition
Back to ASP
The if statement examines a variable for a condition.
The following code displays the date and time, and the if condition says that if the hour is less than 12 it is the morning, and the else condition says it is afternoon.
<html>
<head><title>Arrays</title></head>
<body>
<%
Dim LtHour, lcMessage
LtHour = hour(now())
response.write("The date and time is " & now())
if LtHour < 12 then
lcMessage = "Time to get up!"
else
lcMessage = "Time to go to bed!"
end if
response.write("<br /><br />" & lcMessage)
%>
</body>
</html>