home *** CD-ROM | disk | FTP | other *** search
- <%
- '*******************************************************
- '* ASP 101 Sample Code - http://www.asp101.com *
- '* *
- '* This code is made available as a service to our *
- '* visitors and is provided strictly for the *
- '* purpose of illustration. *
- '* *
- '* Please direct all inquiries to webmaster@asp101.com *
- '*******************************************************
- %>
-
- <%
- ' This function takes two integers and ads them together.
- Function Add(intA, intB)
- ' Declare a variable to store the result.
- ' Since it was declared inside the function
- ' you can only access this variable while
- ' you're inside the function.
- Dim intResult
-
- ' Do our calculation and store the result.
- intResult = intA + intB
-
- ' Set our return value by assigning it
- ' to the function's name.
- Add = intResult
- End Function
- %>
- <p>Here are a couple examples of calling the function:</p>
-
- <p>1 + 2 = <%= Add(1, 2) %></p>
-
- <p>534 + 3142 = <%= Add(534, 3142) %></p>
-