-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TAnonymousThread.Execute_Sync question.. #134
Comments
Use Execute_Sync only if inside code updates UI like a button, label, etc. In your case seems you're not updating any UI interface. |
Ahhh. Ok. Tks. |
Sorry, Showmessage is UI dialog, you need Execute_Sync() |
This is the complete function:
|
Try something like this:
|
Sorry, I did without an Delphi IDE. You need to change E variable with aException procedure parameter inside OnException. |
@ijbranch Hi, this is how you can use TAnonymousThread in your case:
A few things to consider in your code:
Hope this helps |
Hi @ijbranch , Yes, that is correct. Result to a function can't be captured within a thread. So, there are two options:
I mentioned earlier that you can have a Status field in the class. If you do this, you can have the Styled Message dialogs outside the thread and after the while...do loop. This will also allow you to move all the database operations to a class separating the business model from the UI part of your application. |
D12.2, 32 bit App.
I have implemented this code:
I interpreted Execute_Sync would allow me to move the Form while the thread executed.
It would seem not.
How to be able to please?
Regards & TIA,Ian
The text was updated successfully, but these errors were encountered: