home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / Variables_JScript.asp < prev    next >
Text File  |  1997-10-25  |  2KB  |  91 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 + intVariable%></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 = true;
  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.         <HR>
  69.         <H3> Date and Time </h3>
  70.  
  71.         <%
  72.             // Declare variable
  73.             var dtmVariable;
  74.  
  75.             // Assign the variable a value
  76.             dtmVariable = new Date(1997, 08, 27, 17, 11, 42);
  77.         %>
  78.  
  79.         <P>The date and time is <%=dtmVariable%> </p>
  80.  
  81.         <%
  82.             // Set the variable to the web server date and time
  83.             dtmVariable = new Date();
  84.         %>
  85.  
  86.         <P>The <STRONG>system</strong> date and time
  87.         is <%=dtmVariable%></p>
  88.  
  89.     </BODY>
  90. </HTML>
  91.