One Subroutine after another

Discussion in 'ASP .Net' started by MRW, Aug 31, 2006.

  1. MRW

    MRW Guest

    Hello!

    I'm running two subroutines one after another. The first subroutine
    works and does something to a several session variables (just an
    example), then those session variables are accessed by the second
    subroutine.

    I'm noticing however, that it looks like the second subroutine is being
    called before the first is done.

    Does anybody have any experience with this?

    Thanks for any help!
     
    MRW, Aug 31, 2006
    #1
    1. Advertising

  2. MRW

    David Wier Guest

    Show us your code on how your calling the two routines

    --
    David Wier
    MVP/ASPInsider
    http://aspnet101.com
    http://aspexpress.com



    "MRW" <> wrote in message
    news:...
    > Hello!
    >
    > I'm running two subroutines one after another. The first subroutine
    > works and does something to a several session variables (just an
    > example), then those session variables are accessed by the second
    > subroutine.
    >
    > I'm noticing however, that it looks like the second subroutine is being
    > called before the first is done.
    >
    > Does anybody have any experience with this?
    >
    > Thanks for any help!
    >
     
    David Wier, Aug 31, 2006
    #2
    1. Advertising

  3. MRW

    MRW Guest

    Very simply:

    subRoutine1()
    subRoutine2()



    David Wier wrote:
    > Show us your code on how your calling the two routines
    >
    > --
    > David Wier
    > MVP/ASPInsider
    > http://aspnet101.com
    > http://aspexpress.com
    >
    >
    >
    > "MRW" <> wrote in message
    > news:...
    > > Hello!
    > >
    > > I'm running two subroutines one after another. The first subroutine
    > > works and does something to a several session variables (just an
    > > example), then those session variables are accessed by the second
    > > subroutine.
    > >
    > > I'm noticing however, that it looks like the second subroutine is being
    > > called before the first is done.
    > >
    > > Does anybody have any experience with this?
    > >
    > > Thanks for any help!
    > >
     
    MRW, Aug 31, 2006
    #3
  4. No, I don't think that can happen. There must be something else going on
    that is making you think that this is the case.

    "MRW" <> wrote in message
    news:...
    > Very simply:
    >
    > subRoutine1()
    > subRoutine2()
    >
    >
    >
    > David Wier wrote:
    >> Show us your code on how your calling the two routines
    >>
    >> --
    >> David Wier
    >> MVP/ASPInsider
    >> http://aspnet101.com
    >> http://aspexpress.com
    >>
    >>
    >>
    >> "MRW" <> wrote in message
    >> news:...
    >> > Hello!
    >> >
    >> > I'm running two subroutines one after another. The first subroutine
    >> > works and does something to a several session variables (just an
    >> > example), then those session variables are accessed by the second
    >> > subroutine.
    >> >
    >> > I'm noticing however, that it looks like the second subroutine is being
    >> > called before the first is done.
    >> >
    >> > Does anybody have any experience with this?
    >> >
    >> > Thanks for any help!
    >> >

    >
     
    Marina Levit [MVP], Aug 31, 2006
    #4
  5. MRW

    MRW Guest

    Okay, thanks... I wasn't too sure... I've programmed in Flash before
    where things like that can happen if your not careful. Wasn't sure if
    there was something similar in NET.

    Thanks again!

    Marina Levit [MVP] wrote:
    > No, I don't think that can happen. There must be something else going on
    > that is making you think that this is the case.
    >
    > "MRW" <> wrote in message
    > news:...
    > > Very simply:
    > >
    > > subRoutine1()
    > > subRoutine2()
    > >
    > >
    > >
    > > David Wier wrote:
    > >> Show us your code on how your calling the two routines
    > >>
    > >> --
    > >> David Wier
    > >> MVP/ASPInsider
    > >> http://aspnet101.com
    > >> http://aspexpress.com
    > >>
    > >>
    > >>
    > >> "MRW" <> wrote in message
    > >> news:...
    > >> > Hello!
    > >> >
    > >> > I'm running two subroutines one after another. The first subroutine
    > >> > works and does something to a several session variables (just an
    > >> > example), then those session variables are accessed by the second
    > >> > subroutine.
    > >> >
    > >> > I'm noticing however, that it looks like the second subroutine is being
    > >> > called before the first is done.
    > >> >
    > >> > Does anybody have any experience with this?
    > >> >
    > >> > Thanks for any help!
    > >> >

    > >
     
    MRW, Aug 31, 2006
    #5
  6. Well it can happen, but it could probably only happen if routine 1 started
    something asynchronous - an asynchronous (non-blocking) call to web service
    perhaps or making use of an IHttpAsyncHandler that altered session on
    completion. if it didn't wait for a return before exciting the method a
    session enabled webservice method or an ihttpasync EndProcessRequest could
    alter session values while the worker thread went on to execute routine 2!
    However, you would have had to code this in and its not for the faint
    hearted.

    If your not coding that complex an application then its unlikely to be
    executing routine2 before 1 completes.
    -
    Regards

    John Timney (MVP)

    --
    --
    Regards

    John Timney (MVP)
    "MRW" <> wrote in message
    news:...
    > Okay, thanks... I wasn't too sure... I've programmed in Flash before
    > where things like that can happen if your not careful. Wasn't sure if
    > there was something similar in NET.
    >
    > Thanks again!
    >
    > Marina Levit [MVP] wrote:
    >> No, I don't think that can happen. There must be something else going on
    >> that is making you think that this is the case.
    >>
    >> "MRW" <> wrote in message
    >> news:...
    >> > Very simply:
    >> >
    >> > subRoutine1()
    >> > subRoutine2()
    >> >
    >> >
    >> >
    >> > David Wier wrote:
    >> >> Show us your code on how your calling the two routines
    >> >>
    >> >> --
    >> >> David Wier
    >> >> MVP/ASPInsider
    >> >> http://aspnet101.com
    >> >> http://aspexpress.com
    >> >>
    >> >>
    >> >>
    >> >> "MRW" <> wrote in message
    >> >> news:...
    >> >> > Hello!
    >> >> >
    >> >> > I'm running two subroutines one after another. The first subroutine
    >> >> > works and does something to a several session variables (just an
    >> >> > example), then those session variables are accessed by the second
    >> >> > subroutine.
    >> >> >
    >> >> > I'm noticing however, that it looks like the second subroutine is
    >> >> > being
    >> >> > called before the first is done.
    >> >> >
    >> >> > Does anybody have any experience with this?
    >> >> >
    >> >> > Thanks for any help!
    >> >> >
    >> >

    >
     
    John Timney \(MVP\), Aug 31, 2006
    #6
    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. sck10

    Calling another subroutine

    sck10, Aug 15, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    455
    =?Utf-8?B?U3JlZWppdGggUmFt?=
    Aug 15, 2005
  2. loveNUNO
    Replies:
    2
    Views:
    924
    loveNUNO
    Nov 20, 2003
  3. Robert Cohen
    Replies:
    3
    Views:
    277
    Andrew Durstewitz
    Jul 15, 2003
  4. Daniel S.
    Replies:
    4
    Views:
    162
    Ben Morrow
    Jul 15, 2004
  5. king
    Replies:
    5
    Views:
    187
Loading...

Share This Page