Subroutines in ASP do not return values. They exist only to perform repetitive tasks. Subroutines also cannot take an object as an argument. So if I wanted to pass a recordset object to a subroutine and have it perform a certain task on it, I wouldn't be able to.
Functions on the other hand do return a value and are use to more or less calculate things or return results. Functions, unlike subroutines, CAN take an object as an argument and therefore manipulate that object.
For instance, I wrote a simple function in order to close a recordset, because I'm lazy.
Example of a function returning a value
-
Function Devide(iNum1,iNum2)
-
iTemp = Num1/Num2
-
Devide = iTemp
-
End Function
-
It takes two arguments, both numbers - devides the numbers, and returns the result by setting the function name ("Devide" in this case) equal to the result, therefore returning the function
Devide(2,2) will return 1
Sincerely,
Mark