home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 9 / IOPROG_9.ISO / contrib / iis4 / iis4_07.cab / Variables_JScript.asp < prev    next >
Encoding:
Text File  |  1997-09-03  |  1.6 KB  |  92 lines

  1. <%@ LANGUAGE = JScript %>
  2.  
  3. <HTML>
  4.     <HEAD>
  5.         <TITLE>Variable Sample</TITLE>
  6.     </HEAD>
  7.  
  8.     <BODY BGCOLOR="White" topmargin="10" leftmargin="10">
  9.  
  10.  
  11.         <!-- Display Header -->
  12.  
  13.         <font size="4" face="Arial, Helvetica">
  14.         <b>Variable Sample</b></font><br>
  15.       
  16.       
  17.         <hr>
  18.         <H3> Integer Manipulaiton </h3>
  19.  
  20.         <%
  21.             // Declare variable
  22.             var intVariable;
  23.  
  24.             // Assign the variable an integer value
  25.             intVariable = 5;
  26.         %>
  27.  
  28.         <P><%=intVariable%> + <%=intVariable%> =
  29.         <%=intVariable + 5%></p>
  30.  
  31.  
  32.         <HR>
  33.         <H3> String Manipulation </h3>
  34.  
  35.         <%
  36.             // Declare variable
  37.             var strVariable
  38.  
  39.             // Assign the variable a string value
  40.             strVariable = "Jemearl"
  41.         %>
  42.  
  43.  
  44.         <P>This example was done by: <%=strVariable + " Smith" %></p>        
  45.  
  46.  
  47.         <HR>
  48.         <H3> Boolean Manipulation </h3>
  49.  
  50.         <%
  51.             // Declare variable
  52.             var blnVariable
  53.  
  54.             // Assign the variable a boolean value
  55.             blnVariable = new Boolean()
  56.  
  57.             // Output Message based on value
  58.             if (blnVariable = true) 
  59.             {
  60.                 Response.Write("<P>The boolean value is true.</p>");
  61.             }
  62.             else
  63.             {
  64.                 Response.Write("<P>The boolean value is false.</p>");
  65.             }
  66.         %>
  67.         
  68.         
  69.         <HR>
  70.         <H3> Date and Time </h3>
  71.  
  72.         <%
  73.             // Declare variable
  74.             var dtmVariable;
  75.  
  76.             // Assign the variable a value
  77.             dtmVariable = new Date(1997, 08, 27, 17, 11, 00)
  78.         %>
  79.  
  80.         <P>The date and time is <%=dtmVariable%> </p>
  81.  
  82.         <%
  83.             // Set the variable to the web server date and time
  84.             dtmVariable = new Date();
  85.         %>
  86.  
  87.         <P>The <STRONG>system</strong> date and time
  88.         is <%=dtmVariable%></p>
  89.  
  90.     </BODY>
  91. </HTML>
  92.