ASP Classic Sub & function Example
If you define the following sub and funtion:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Subs and Functions
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub DoSomeCode(ByRef pMessage)
Response.Write pMessage
End Sub
Function GetLastDOW(ADate, AWeekDayConst)
While Weekday(ADate) <> AWeekDayConst
ADate = DateAdd("d", -1, ADate)
Wend
GetLastDOW = ADate
End Function
You can call them. For example:
DoSomeCode "Hello3"
Response.Write "Last Monday was " & GetLastDOW(Date, vbMonday)