|
If then example
A simple If Then example for beginners , this
example will retrieve the hour of the day and depending on whether
it is before 12 or after 12 will display a message
Code:
<%
'a beginners example showing If Then else
Dim dtmDate
'get the hour of the day from the Now function
dtmDate = Hour(Now)
'now for our If Then Else statement
'if hour is less than 12 then display a message
If dtmDate < 12 then
Response.Write "it is before noon"
'if hour is greater than 12 then display a message
Else
Response.Write "it is after noon"
End if
%>
|