home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 9 / IOPROG_9.ISO / contrib / iis4 / iis4_07.cab / Functions_JScript.asp < prev    next >
Encoding:
Text File  |  1997-09-03  |  1.0 KB  |  55 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> This sample demonstrate how to use server side
  39.         script functions.  The function "PrintOutMsg" has been defined
  40.         on the server.  It prints out a specific message a set number of
  41.         times.<p>
  42.         
  43.  
  44.         <%
  45.             // Call Function            
  46.             x = PrintOutMsg("This is a function test!", 4);
  47.  
  48.             // Output the function return value
  49.             Response.Write("<p>The function printed out the message " + x + " times.");
  50.         %>
  51.  
  52.  
  53.     </BODY>
  54. </HTML>
  55.