<% '******************************************************* '* 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. * '* * '* http://www.asp101.com/samples/license.asp * '* * '* 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 %>

Here are a couple examples of calling the function:

1 + 2 = <%= Add(1, 2) %>

534 + 3142 = <%= Add(534, 3142) %>