setting variable with function's result

Posted by zurna on Stack Overflow See other posts from Stack Overflow or by zurna
Published on 2010-04-15T02:10:25Z Indexed on 2010/04/15 2:13 UTC
Read the original article Hit count: 335

Filed under:

I call the following function with

Call GameTimer(FormatDate(objLiveCommentary("DateFirstStarted"), "WithTime"), FormatDate(objLiveCommentary("DateSecondStarted"), "WithTime"), "Soccer")

And it prints results as 23, 35, 64, 90. I want to take this result and store it as CurrentGameTime = because I will save CurrentGameTime to my database. How can I do it?

Function GameTimer (FirstStarted, SecondStarted, GameType)

If GameType =   "Soccer"    Then
    DateFirstStarted    = DateDiff("n", FirstStarted, FormatDate(NOW(), "WithTime"))
    DateSecondStarted   = DateDiff("n", SecondStarted, FormatDate(NOW(), "WithTime"))

    If DateFirstStarted <= 45 Then
    Response.Write DateFirstStarted
    ElseIf DateFirstStarted <= 45 Then
    DateFirstStarted
    ElseIf DateSecondStarted <= 45 Then
    Response.Write DateSecondStarted + 45
    ElseIf DateFirstStarted <= 45 Then
    DateFirstStarted
    Else 
    Response.Write "90"
    End If  
End If

End Function

© Stack Overflow or respective owner

Related posts about asp-classic