ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need Help with Set Object = Collection(index) (https://www.excelbanter.com/excel-programming/343214-need-help-set-object-%3D-collection-index.html)

Trip[_3_]

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


Peter T

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" wrote in message
oups.com...
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





All times are GMT +1. The time now is 11:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com