UPDATE: This is the WIP Function.
<%
Function ReturnTwoValues(Data)
If Data= Now() Then
Var1= "ABC"
Var2= "000"
Else
Var1= "CDE"
Var2= "111"
End If
ReturnTwoValues = Array(Var1, Var2)
End Function
a = ReturnTwoValues(Data)
Value1= a(0)
Value2= a(1)
%>
My doubt now is: How can I invoke the function? If I do Response.Write Value1
and Response.Write Value2
I can get the value, but I need to pass the parameter first. Something like ReturnTwoValues(Now())
, but if I do it, how could I be able to get the first and the second value?
ORGINAL QUESTION:
I have this pseudo function and would like to be able to return the value from Variable1
and Variable2
:
<%
Today= Now()
Function TellsMeTheTime(Date_Field)
If IsNull(Date_Field) = False Or Date_Field <> "" Then
DaysAmount= DateDiff("d", Date_Field, Today)
Select Case True
Case DaysAmount = 0
Variable1 = "warning"
Variable2 = "text1"
Case DaysAmount > 1
Variable1 = "danger"
Variable2 = "text2 " & DaysAmount & " text3"
Case DaysAmount = -1
Variable1 = "warning"
Variable2 = "text4"
Case DaysAmount = -2, -3, -4, -5, -6, -7
Variable1 = "warning"
Variable2 = "text5 " & Right(DaysAmount, Len(DaysAmount) - 1) & " text6"
Case DaysAmount <= -8
Variable1 = "success"
Variable2 = "text7 " & Right(DaysAmount, Len(DaysAmount) - 1) & " text8"
Case DaysAmount = ""
Variable1 = "danger"
Variable2 = "text9 " & DaysAmount & " text10"
Case Else
Variable1 = "warning"
Variable2 = "text11 " & Right(DaysAmount, Len(DaysAmount) - 1) & " text12"
End Select
Else
Variable1 = "danger"
Variable2 = "text12"
End If
End Function
%>
How can I do this?