Global.asa and functions

Results 1 to 2 of 2

Thread: Global.asa and functions

  1. #1
    Join Date
    Dec 1969

    Default Global.asa and functions

    I have written a function to find and remove selected string values, the function works fine in an asp page but doesn&#039;t work in the Global.asa can you use functions in the Global.asa file?<BR><BR>If so any ideas why the code below doesn&#039;t work<BR><BR>&#060;SCRIPT LANGUAGE="VBScript" RUNAT="Server"&#062;<BR><BR>Sub Application_OnStart<BR><BR><BR> Session.Timeout = 1<BR><BR><BR> Application.Lock<BR> Application("whoson") = ""<BR> Application.UnLock<BR><BR><BR>End Sub<BR><BR><BR>Sub Session_OnStart<BR><BR><BR> Application.Lock<BR> Application("whoson") = Application("whoson") & Session.SessionID & Request.Cookies("WhobaFirst")<BR> Application.UnLock<BR><BR><BR>End Sub<BR><BR> Function RemoveStr(strContent, strRemove)<BR><BR> nStart = InStr(1, strContent, strRemove)<BR> nEnd = nStart + Len(strRemove)-1<BR> LeftLen = nStart -1<BR> RightLen = Len(strContent) - nEnd<BR> strLeft = Left(strContent, LeftLen)<BR> strRight = Right(strContent, RightLen)<BR> RemoveStr = strLeft & strRight<BR><BR> End Function<BR><BR>Sub Session_OnEnd<BR><BR> Application.Lock<BR> strMain = Application("whoson")<BR> strOut = Session.SessionID & Request.Cookies("WhobaFirst")<BR> Application("whoson") = RemoveStr(strMain, strOut)<BR> Application.UnLock<BR><BR>End Sub<BR><BR>&#060;/SCRIPT&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Global.asa and functions

    should be fine. you can have functions in there, they&#039;re just a little harder to debug.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts