Application Object Or Variable!

Discussion in 'ASP General' started by Arpan, Jul 24, 2005.

  1. Arpan

    Arpan Guest

    The following code exists in a Global.asa file:

    ----------------------------------------------
    <%
    Set Application("Thing")=Server.CreateObject("THINGDOER.THINGY")
    %>
    ----------------------------------------------

    Will the above code snippet


    create a non-object Application variable named "Thing" & place it in
    the Contents collection of the Application object?

    -----OR------

    create an Application object named "Thing" & place it in the
    StaticObjects collection of the Application object?

    Thanks,

    Arpan
    Arpan, Jul 24, 2005
    #1
    1. Advertising

  2. Arpan

    Mark Schupp Guest

    "Arpan" <> wrote in message
    news:...
    > The following code exists in a Global.asa file:
    >
    > ----------------------------------------------
    > <%
    > Set Application("Thing")=Server.CreateObject("THINGDOER.THINGY")
    > %>
    > ----------------------------------------------
    >
    > Will the above code snippet
    >
    >
    > create a non-object Application variable named "Thing" & place it in
    > the Contents collection of the Application object?
    >
    > -----OR------
    >
    > create an Application object named "Thing" & place it in the
    > StaticObjects collection of the Application object?
    >
    > Thanks,
    >
    > Arpan
    >


    It will create an application variable and set it to an object. This is not
    considered wise unless the object is designed specifically for a
    multi-threaded environment.

    If you want the object in the staticobjects collection you will need to use
    an <object> tag in global.asa to create it (again, make sure it is designed
    for this)>

    <object id="thing" progid="THINGDOER.THINGY" runat="Server"
    scope="Application"></object>

    --
    Mark Schupp
    Mark Schupp, Jul 25, 2005
    #2
    1. Advertising

  3. Arpan

    Arpan Guest

    Thanks Mark :)

    Regards,

    Arpan
    Arpan, Jul 26, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. THY
    Replies:
    3
    Views:
    463
    Radderz
    Sep 4, 2006
  2. Neo Geshel
    Replies:
    6
    Views:
    4,239
    Cerebrus
    Mar 23, 2006
  3. pratham
    Replies:
    3
    Views:
    673
    sloan
    Aug 31, 2006
  4. mfglinux
    Replies:
    11
    Views:
    670
    Roberto Bonvallet
    Sep 12, 2007
  5. David Filmer
    Replies:
    19
    Views:
    217
    Kevin Collins
    May 21, 2004
Loading...

Share This Page