home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 9 / IOPROG_9.ISO / contrib / iis4 / iis4_07.cab / variable_vbscript.asp < prev    next >
Encoding:
Text File  |  1997-08-29  |  1.6 KB  |  118 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.         <hr size="1" color="#000000">
  18.  
  19.  
  20.         <!-- Integer Variable Sample -->
  21.  
  22.  
  23.         <H3> Integer Manipulaiton </h3>
  24.  
  25.  
  26.         <%
  27.  
  28.             ' Declare variable
  29.  
  30.             Dim intVariable
  31.  
  32.  
  33.             ' Assign the variable an integer value
  34.  
  35.             intVariable = 5
  36.  
  37.         %>
  38.  
  39.         <P><%=intVariable%> + <%=intVariable%> = <%=intVariable + 5%></p>
  40.  
  41.         <HR>
  42.  
  43.         <H3> String Manipulation </h3>
  44.  
  45.         <%
  46.  
  47.             ' Declare variable
  48.  
  49.             Dim strVariable
  50.  
  51.             ' Assign the variable a string value
  52.  
  53.             strVariable = "Jemearl"
  54.  
  55.         %>
  56.  
  57.         <P>This example was done by: <%=strVariable + " Smith" %></p>        
  58.  
  59.  
  60.         <HR>
  61.  
  62.         <H3> Boolean Manipulation </h3>
  63.  
  64.         <%
  65.  
  66.             ' Declare variable
  67.  
  68.             Dim blnVariable
  69.  
  70.             ' Assign the variable a boolean value
  71.  
  72.             blnVariable = true
  73.  
  74.         %>
  75.  
  76.  
  77.         <% if blnVariable = true then %>
  78.         
  79.         <P>The boolean value is true.</p>
  80.         
  81.         <% else %>
  82.         
  83.         <P>The boolean value is false.</p>
  84.  
  85.         <% end if %>
  86.  
  87.         <HR>
  88.  
  89.         <H3> Date and Time </h3>
  90.  
  91.         <%
  92.  
  93.             ' Declare variable
  94.  
  95.             Dim dtmVariable
  96.  
  97.             ' Assign the variable a value
  98.  
  99.             dtmVariable = #08 / 27 / 97 5:11:00pm#
  100.  
  101.         %>
  102.  
  103.         <P>The date and time is <%=dtmVariable%> </p>
  104.  
  105.         <%
  106.  
  107.             ' Set the variable to the web server date and time
  108.  
  109.             dtmVariable = Now
  110.  
  111.         %>
  112.  
  113.         <P>The <STRONG>system</strong> date and time is <%=dtmVariable%></p>
  114.  
  115.  
  116.     </BODY>
  117. </HTML>
  118.