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

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