Home  |  Latest News  |  Contribute  |  F.A.Q.  |  Account  |  Scripts | About
Search ASPNut:
 
ASP Reference
Server Variables
ASP Glossary
Related Sites

Free Components

HTML Reference
Web Colors
Entities
CSS Level 1
Encode/Decode
Glossary

Our Sponsors
ASP Nuke CMS
Free Auctions
PHP 5 Script
Funktastic Blog
ULost Directory
Team Task

 

 

 

 

 

 

 

 

 

 

 

 

Function

The Function statement allows you to declare a function that takes a variabe number of arguments and returns a value to the caller after performing some work.

A function is identical to a subroutine except that the subroutine is not allowed to return a value whereas a function is expected to return a value.

' calculate how many hours old a person is Function HoursOld(dBirthday)
    HoursOld = DateDiff("h", Now(), dBirthday)
End Function


You may also use the Exit Function within a function to immediately exit the function based on a condition. An example of this is shown below:

' calculate how many hours old a person is Function HoursOld(dBirthday)
    If Not IsDate(dBirthday) Then Exit Function
    HoursOld = DateDiff("h", Now(), dBirthday)
End Function

Orvado Technologies

ASP Nuke CMS
Free Open Source
Content Manager
HomeFix Boards
Home Remodeling
Message Boards

Contact Us | Contribute | About | Site Map



"Life is wasted on the living." - Douglas Adams

©2010 San Diego Web Design - Orvado Technologies, All Rights Reserved
ASP Nut provides articles and reference documentation for Active Server Page developers.