<%@ page import="diamondedge.asp.*,diamondedge.util.*,diamondedge.ado.*" %>
<%!

public int PrintOutMsg( String msg, int count )
{
   int PrintOutMsg = 0;
   try
   {
     int i = 0;

     // Output Message count times
     for( i = 1; i <= count; i++ )
     {
       Asp.out().print( msg + "<BR>" );
     }

     // Return number of iterations
     PrintOutMsg = count;
   }
   catch(Exception _e_) { Err.set(_e_,"PrintOutMsg"); }
   return PrintOutMsg;
}
%>

<%
   int x = 0;
   Asp.init( request, response, out );
%>


<%
   // Define Server Side Script Function
%>

<HTML>
<HEAD>
     <TITLE>Functions</TITLE>
</HEAD>

<BODY bgcolor="white" topmargin="10" leftmargin="10">

<!--  Display Header -->

     <font size="4" face="Arial, Helvetica">
     <b>Server Side Functions</b></font><br>

     <p>
     The function "PrintOutMsg" prints out a specific message a set number of times.
     <p>

     <%
   // Store number of times Function printed message
   // Call Function
   x = PrintOutMsg( "This is a function test!", 4 );

   // Output the function return value
   out.print( "<p>The function printed out the message " + x + " times." );

%>

</BODY>
</HTML>