Home > database >  Questions about the post event
Questions about the post event

Time:09-20

I have a question is that the data window are respectively set up three field in quantity, unit price, amount, normal number should be the amount=x unit price, but occasionally amount & lt;> Number x unit price (the error is not caused by the reason of numerical precision, is completely wrong), I cleared a lot of times still cannot determine code where there is wrong, is I'm going to give up to find a post event before saving is used to calculate the amount, I think the post event triggering time is not sure, is it possible when the data window has been update system after a post event to trigger the calculation process,

I just want to know if the above I said this problem is possible,

CodePudding user response:

Can you stick the code up to look at it?

CodePudding user response:

If the call asynchronous trigger events, in a piece of code, back to the first end of the event or function performs an asynchronous call, and then back to trigger an asynchronous call event or function, is an asynchronous call by default in the currently executing code finally

CodePudding user response:

N the process of the nested multiple events, all can't post, I can only roughly, for example,

//the following is a process of click save button
Dw_1. Post setitem (" a ", ldc_temp)
.
.
Dw_1. The update ()

Actual code nested is very complex, of course, I can't list all the, if is similar to that piece of code will not cause fields before saving didn't write a data?

CodePudding user response:

refer to the second floor ssawendure response:
if the call asynchronous trigger events, in a piece of code, back to the first end of the event or function performs an asynchronous call, and then back to trigger an asynchronous call event or function, is an asynchronous call the default in the end of the currently executing code


I'm this post event be nested in to save one of the events (such as event a), so can you tell me where the post event at the latest when the called?

Problems added: this post is the latest in events after a call immediately, or may be invoked in the preservation after the event?

CodePudding user response:

This example as you, I think that the set of code are executed after the update, the post is the message in the window again arrange the meaning of the message queue, is lagging behind, hysteresis is the current event,

CodePudding user response:

reference 5 floor Dersak reply:
this example as you, I think that the set of code are executed after the update, the post is the message in the window again arrange the meaning of the message queue, is lagging behind, hysteresis is the current event,


Because I this post event is nested in to save one of the events (such as event a), so can you tell me where the post event at the latest when the called?

Problems added: this post is the latest in events after a call immediately, or may be invoked in the preservation after the event? I've tested many times, each test post setitem event is called before the update, but because I'm not sure if the party is called post event time so you also want to ask clear, me if there is problem on the program design

CodePudding user response:

First of all, I want to say, nothing is absolutely necessary, you don't need to add a post to cause brain disorder, routine, not nested in the event the post, I'm suggesting you will post all take out, unless you have the necessary requirements, then you can say, we help you to see if it is necessary to add the post, Windows message queue, anyone's guess what, we are not of the operating system, don't know which thread when can perform, these are the CPU word,

CodePudding user response:

In addition, you can refer to this post and see my reply,
http://bbs.csdn.net/topics/390059325

CodePudding user response:

reference 4 floor angloy response:
Quote: refer to the second floor ssawendure response:

If the call asynchronous trigger events, in a piece of code, back to the first end of the event or function performs an asynchronous call, and then back to trigger an asynchronous call event or function, is an asynchronous call the default in the end of the currently executing code


I'm this post event be nested in to save one of the events (such as event a), so can you tell me where the post event at the latest when the called?

Problems added: this post is the latest in events after a call immediately, or may be invoked in the preservation after the event?


A simple example
Funciton wf_3 ()
(
Sle_1. Text='wf_3'

Sle_1. Postevent (' ue_test ')

Wf_2 ()
)

Wf_2 ()
(

Sle_1. Text='wf_2'
The function post wf_1 ()

Return 1
)

So the execution wf_3 (), is
Put sle_1 event before finally, execute wf_2 (),
In performing wf_2 () because wf_1 () is an asynchronous trigger again on the last
Such wf_3 performed later, begin to execute ue_test events, and then execute wf_1 ()

CodePudding user response:

Because there has been no online reply late, I'm sorry, the post is put to asynchronous execution of the event or function in the whole of the body of the function or event in the end, the execution of the the function body or event body will return to later executed in sequence is the object of the post, all through the post amounts to a queue, first put in execution,

/the following is a process of click save button
Dw_1. Post setitem (" a ", ldc_temp)
.
.
Dw_1. The update ()
You write will update first, and then set the value of the field, so the problem will be very big

CodePudding user response:

Now as an aside, in my understanding, like the pb has always been a single thread, of course, if you are kind, get an external function, make a new thread to, I also don't strange, because, I also tried to do an external dynamic library in c + +, the purpose is to create a new thread, pop up a window alone, want to achieve purpose is to let this window can display a can move GIF images (such as a progress bar), because, if you are in a single thread of pb in the budget of high load, is can't do it at the same time also can display the animation, can only see a static image, so, from which I came to the conclusion pb also impossible what asynchronous, code simply using post change execution order, it's not called asynchronous! May I say the work some exercises, but I still hope in the field of technology to some relatively serious, if I say wrong, also can have some one, please I really appreciate,

CodePudding user response:

Say first issue of the building Lord, your this kind of writing is a sure method to perform post again after the update, don't understand why you write so, the characteristics of the post is put to invoke event or method in the current code of after the event or method to carry out, sometimes ok sometimes not, as to what you say may be you are not careful to update again? The second update to save the post for the first time, so the time is not normal,
As to the problem of 11 floor said pb multithreading, post is just change the order of execution, and not to open a process, this is not called asynchronous, but in fact pb can achieve similar threads, I generally is to use one or more hidden Windows open, or openuserobject multiple user controls, open their timer events, basically the timer event in the code will be in the form of multiple threads to run, you can have a try, as you said that can only see a static image, even the use of c + + to write, if the requirements of system resources is high, it may also be (probability is small, of course, the probability of c # could be slightly bigger than it), only the pb to handle, the question would have a better chance.
  • Related