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

  1. <%@ LANGUAGE = VBScript %>
  2. <%  Option Explicit     %>
  3.  
  4. <HTML>
  5.     <HEAD>
  6.         <TITLE>Variable 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>Variable Sample</b></font><br>
  16.       
  17.       
  18.         <hr>
  19.         <H3> Integer Manipulaiton </h3>
  20.  
  21.         <%
  22.             ' Declare variable
  23.             Dim intVariable
  24.  
  25.             ' Assign the variable an integer value
  26.             intVariable = 5
  27.         %>
  28.  
  29.  
  30.         <P><%=intVariable%> + <%=intVariable%> =
  31.         <%=intVariable + intVariable%></p>
  32.  
  33.  
  34.         <HR>
  35.         <H3> String Manipulation </h3>
  36.  
  37.         <%
  38.             ' Declare variable
  39.             Dim strVariable
  40.  
  41.             ' Assign the variable a string value
  42.             strVariable = "Jemearl"
  43.         %>
  44.  
  45.         <P>This example was done by    <%=strVariable + " Smith" %></p>        
  46.  
  47.  
  48.         <HR>
  49.         <H3> Boolean Manipulation </h3>
  50.  
  51.         <%
  52.             ' Declare variable
  53.             Dim blnVariable
  54.  
  55.             ' Assign the variable a boolean value
  56.             blnVariable = true
  57.             
  58.             ' Output message based on value
  59.             If (blnVariable = true) Then
  60.               Response.Write "<P>The boolean value is True.</P>"
  61.             Else
  62.               Response.Write "<P>The boolean value is False.</P>"
  63.             End If
  64.         %>
  65.         
  66.         <HR>
  67.         <H3> Date and Time </h3>
  68.  
  69.         <%
  70.             ' Declare variable
  71.             Dim dtmVariable
  72.  
  73.             ' Assign the variable a value
  74.             dtmVariable = #08 / 27 / 97 5:11:42pm#
  75.         %>
  76.  
  77.         <P>The date and time is <%=dtmVariable%> </p>
  78.  
  79.         <%
  80.             ' Set the variable to the web server date and time
  81.             dtmVariable = Now
  82.         %>
  83.  
  84.         <P>The <STRONG>system</strong> date and time is
  85.         <%=dtmVariable%></p>
  86.  
  87.     </BODY>
  88. </HTML>
  89.