I want to have one of my posted events get fired at the last in firing order.
Is there any way possible to set priority sequence number for a posted event?
Does custom Event ID somehow help to get an event posted when all other posted events are fired already?
A parent sheet defines an event InTheEnd() and post it. When a new window inherit from parent sheet, may post many other events which i dont know how many and in what order they are posted. so I cannot tell how many events will be posted and from which events they will be posted from child window. Is it possible to set InTheEnd() in a way it always fires when other posted events in child window are already fired?
I did not know yield() had any effects on events firing order. Some time ago when i was working on how to cancel long running DB query i used yield() function in couple of events in the parent window. Those 2 places where i used yield() actually changed the events firing order which was logically not correct. That thing wasted many hours to figure out where is the problem. After i got your response i removed those yield() and every posted event finally came back into logically correct sequence. After this correction i needed to post a new InTheEnd() event from parent window and wanted it to be the last executed event in child. That was possible with Post call to InTheEnd() Inside a Posted event. for example Counstructor posted _Constructor() and further _Counstructor() posted __constructor(). This way __constructor() came at the last position in firing order.
In a parent child relation if all events are extended then all events execute in pairs for example in the following _Open is posted event from Open. __Constructor() posted from _Constructor() and _Constructor posted from Constructor() of a text control.
Sequence is as follows
----------------------
Parent:Constructor (text control)
Child:Constructor (text control)
Parent:Open
Child:Open
Parent:Activate
Child:Activate
Parent:_Constructor (text control)
Child:_Constructor (text control)
Parent:_Open
Child:_Open
Parent:__Constructor(text control)
Child:__Constructor (text control)
I used following for some app logic.
Parent:Constructor (text control)
Parent:__Constructor (text control)
I can use Child:__Constructor as well but i dont need it right now. And of course i will have to open every child window to write script which i avoided and wrote a generally common functionality in Parent:Constructor that i need when inherited window open and Parent:__Constructor after all other posted events are done.
Thanks you so much for help.
True Regard,
Berka
FYI: The YIELD() command does *not* change the "order of events" (MS Message processing) in the queue. All it does is place a new Message at the End-of-the-Queue and wait for it to be posted back to the App. Thus, allowing events (messages) *already* in the queue to be processed ahead of this new message. AKA: "Hiccup Wait".
Regards ... Chris