+ Reply to Thread
Results 1 to 2 of 2

Need Help with Set Object = Collection(index)

  1. #1
    Trip
    Guest

    Need Help with Set Object = Collection(index)

    Hi all,

    A little insight would be greatly appreciated,

    I have a collection of instances of a class (object = Market,
    collection = Markets). When I received an .ondata event I "Set
    Market = Markets(IndexNumber)" based upon the market which received
    the .ondata event. I then process a series of subs and functions.

    My question is this, while processing the series of subs and functions
    what happens if I receive another .ondata event for a different market?
    Will the "Set Market = Markets(IndexNumber)" happen while I'm in
    the middle of processing the other market?
    How would you all recommend preserving the state of "Set Market ="
    while I'm in the midsts of processing. Or, is this even necessary.
    I'm hoping that the current thread would have precedence over the
    ..ondata event.

    Any insight you may have to share would be greatly appreciated.

    Thanks,

    Trip


  2. #2
    Peter T
    Guest

    Re: Need Help with Set Object = Collection(index)

    Hi Trip,

    I imagine (??) that your .ondata event won't fire until your other code has
    finished processing. Though I'm not certain, eg if you have DoEvents in your
    code I guess it might.

    Howabout, when you finish processing be sure to "Set Market = Nothing", and
    before setting Market in your new event

    If Not Market is Nothing then
    'hmm still working with Market
    ' Stop ' & debug what's going on
    Application,OnTime Now, "proc to go back & set the new market stuff"
    Exit Sub
    End If

    Only a thought!

    Regards,
    Peter T



    "Trip" <[email protected]> wrote in message
    news:[email protected]...
    > Hi all,
    >
    > A little insight would be greatly appreciated,
    >
    > I have a collection of instances of a class (object = Market,
    > collection = Markets). When I received an .ondata event I "Set
    > Market = Markets(IndexNumber)" based upon the market which received
    > the .ondata event. I then process a series of subs and functions.
    >
    > My question is this, while processing the series of subs and functions
    > what happens if I receive another .ondata event for a different market?
    > Will the "Set Market = Markets(IndexNumber)" happen while I'm in
    > the middle of processing the other market?
    > How would you all recommend preserving the state of "Set Market ="
    > while I'm in the midsts of processing. Or, is this even necessary.
    > I'm hoping that the current thread would have precedence over the
    > .ondata event.
    >
    > Any insight you may have to share would be greatly appreciated.
    >
    > Thanks,
    >
    > Trip
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1