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

  1. <% @Language=JScript %>
  2.  
  3.  
  4. <Script Language=JScript RunAt=Server>
  5.  
  6.     // Define Server Side Script Function
  7.  
  8.     function PrintOutMsg(msg, count)
  9.     {
  10.         // Output Message count times
  11.  
  12.         for(i = 0; i < count; i++)
  13.         {
  14.             Response.Write(msg + "<BR>");
  15.         }
  16.  
  17.  
  18.         // Return number of iterations
  19.         
  20.         return count;
  21.     }
  22.     
  23. </Script>
  24.  
  25.  
  26. <HTML>
  27.     <HEAD>
  28.         <TITLE>Functions</TITLE>
  29.     </HEAD>
  30.  
  31.     <BODY bgcolor="white" topmargin="10" leftmargin="10">
  32.         
  33.         <!-- Display Header -->
  34.  
  35.         <font size="4" face="Arial, Helvetica">
  36.         <b>Server Side Functions</b></font><br>   
  37.  
  38.         <p>
  39.         The function "PrintOutMsg" prints out a specific message a set number of times.
  40.         <p>
  41.         
  42.  
  43.         <%
  44.             // Call Function            
  45.             x = PrintOutMsg("This is a function test!", 4);
  46.  
  47.             // Output the function return value
  48.             Response.Write("<p>The function printed out the message " + x + " times.");
  49.         %>
  50.  
  51.  
  52.     </BODY>
  53. </HTML>
  54.