Function / Sub
Try it yourself →Subroutine definition.
Syntax
Function name(p) ... name = ... End Function
Description
Function returns a value (name = result); Sub does not return one. The return value is assigned to the function's name.
Example
<% Function Square(x) Square = x * x End Function Response.Write Square(5) %>
Expected output
25
When to use?
Preventing code repetition.