Development Articles
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherDevelopment Articles

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old July 16th, 2003, 03:00 PM
ducani
Guest
ASP Free Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Introduction To The GLOBAL.ASA For ASP Programmers

Introduction To The GLOBAL.ASA For ASP Programmers

Jul 16, 2003 - I spent quite a bit of time as an ASP programmer before I learned about the GLOBAL.ASA file. Like many others, I learned ASP the old fashioned way. Already familiar with Visual Basic, the leap to VBScript was not difficult. Then I took a look at some sample ASP code, starting doodling with it, and next thing you know, I’m an ASP programmer.

Discuss this article in this thread. You can read the article here .

Reply With Quote
  #2  
Old July 16th, 2003, 06:01 PM
jamsoft jamsoft is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Coral Springs, FL
Posts: 1 jamsoft User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Article

Hi,

My name is Rich Smith, and I am the author of this article. I would be happy to answer any questions via this forum or email.

Thanks for reading it.

Rich

Reply With Quote
  #3  
Old July 23rd, 2003, 09:16 AM
jpenn
Guest
ASP Free Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Pretty good and informative article Rich...

Reply With Quote
  #4  
Old March 28th, 2004, 03:44 AM
gedda gedda is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 gedda User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Global.asa - combining scripts

Hi.
I'm wondering how to "merge" two global.asa files into one. I have the sourcecode for both global.asa's but need to combine them into one, and don't know how. Can you tell me?

Below are both global.asa's. The first one i for an asp-chatroom, the second is for an "online users" count.

Global.asa #1 - ASP Chat:
<script language="Vbscript" runat="server">
Sub Application_onStart
Application("OnLine") = 0
End Sub

Sub session_onStart
session.timeout=15
Application("OnLine") = Application("OnLine")+1
End sub

Sub session_onEnd
Application("OnLine") = Application("OnLine")-1
If session("name") <> "" then
APPLICATION.LOCK
Application("spjallarar") = Replace(application("spjallarar"), session("name") & "§", "")
Application("txt20") = Application("txt19")
Application("txt19") = Application("txt18")
Application("txt18") = Application("txt17")
Application("txt17") = Application("txt16")
Application("txt16") = Application("txt15")
Application("txt15") = Application("txt14")
Application("txt14") = Application("txt13")
Application("txt13") = Application("txt12")
Application("txt12") = Application("txt11")
Application("txt11") = Application("txt10")
Application("txt10") = Application("txt9")
Application("txt9") = Application("txt8")
Application("txt8") = Application("txt7")
Application("txt7") = Application("txt6")
Application("txt6") = Application("txt5")
Application("txt5") = Application("txt4")
Application("txt4") = Application("txt3")
Application("txt3") = Application("txt2")
Application("txt2") = Application("txt1")
Application("txt1") = "<FONT COLOR=""#00C800"">** " & session("name") & " timed out **</FONT>"
APPLICATION.UNLOCK
End If
End Sub


</script>

Global.asa # 2 - Online users count:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
Application("ActiveUsers") = 0
End Sub

Sub Session_OnStart
Session.Timeout = 3
Session("Start") = Now
Application.Lock
Application("ActiveUsers") = Application("ActiveUsers") + 1
Application.UnLock

End Sub
Sub Session_OnEnd
Application.Lock
Application("ActiveUsers") = Application("ActiveUsers") - 1
Application.UnLock
End Sub

</SCRIPT>

Any help will be very much appriciated. Thanks!

Regards, Gedda


Quote:
Originally Posted by jamsoft
Hi,

My name is Rich Smith, and I am the author of this article. I would be happy to answer any questions via this forum or email.

Thanks for reading it.

Rich

Reply With Quote
  #5  
Old April 6th, 2004, 04:23 PM
Rich's Avatar
Rich Rich is offline
Administrator
Developer Shed Admin.
 
Join Date: Sep 2003
Location: Fort Lauderdale, FL
Posts: 151 Rich User rank is Sergeant (500 - 2000 Reputation Level)Rich User rank is Sergeant (500 - 2000 Reputation Level)Rich User rank is Sergeant (500 - 2000 Reputation Level)Rich User rank is Sergeant (500 - 2000 Reputation Level)Rich User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 11 h 37 sec
Reputation Power: 10
Gedda,

Just do ask you asked and merge them. Take the code in the same events, and put it into one. For example:

Global.asa #1 - ASP Chat:
<script language="Vbscript" runat="server">
Sub Application_onStart
Application("OnLine") = 0
End Sub

...

Global.asa # 2 - Online users count:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
Application("ActiveUsers") = 0
End Sub

...

Global.asa # 3 - Combined:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
Application("OnLine") = 0
Application("ActiveUsers") = 0
End Sub

...

Give that a try and let me know how you fare...

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherDevelopment Articles > Introduction To The GLOBAL.ASA For ASP Programmers


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway