home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / Conditional_VBScript.asp < prev    next >
Text File  |  1997-10-25  |  1KB  |  59 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <%  Option Explicit     %>
  3.  
  4. <HTML>
  5.     <HEAD>
  6.         <TITLE>Conditional Operator Sample</TITLE>
  7.     </HEAD>
  8.  
  9.     <BODY BGCOLOR="White" topmargin="10" leftmargin="10">
  10.  
  11.  
  12.         <!-- Display Header -->
  13.  
  14.         <font size="4" face="Arial, Helvetica">
  15.         <b>Conditional Operator Sample</b></font><br>
  16.       
  17.         <hr size="1" color="#000000">
  18.  
  19.  
  20.         <!-- If...Then example -->
  21.  
  22.         <% Dim varDate
  23.            varDate = Date
  24.         %>
  25.  
  26.         <P>The date is: <%=varDate%></p>
  27.  
  28.         <%
  29.           ' Select Case statement to display a message based on the day of the month
  30.             Select Case Day(varDate)
  31.               Case 1,2,3,4,5,6,7,8,9,10
  32.                 Response.Write("<P>It's the beginning of the month.</P>")
  33.               Case 11,12,13,14,15,16,17,18,19,20
  34.                 Response.Write("<P>It's the middle of the month.</P>")
  35.               Case Else
  36.                 Response.Write("<P>It's the end of the month.</P>")
  37.             End Select
  38.         %>
  39.  
  40.         <P>The time is: <%=Time%></P>
  41.  
  42.  
  43.         <%
  44.             ' Check for AM/PM, and output appropriate message
  45.         
  46.             if (Right(Time,2)="AM") Then
  47.             
  48.                 Response.Write("<P>Good Morning</p>")
  49.                 
  50.             Else
  51.             
  52.                 Response.Write("<P>Good Evening</p>")
  53.                 
  54.             End If
  55.         %>
  56.  
  57.     </BODY>
  58. </HTML>
  59.