Roberto P. Well-Known Member Licensed User Longtime User Mar 10, 2017 #1 HI All I created a thread for a procedure a bit long. I see that in the case of exception, does not return the message in the log. how can I do? thanks Code: Copy private sub Import Dim mThread As Thread mThread.Initialise("Thread1") Dim aOk As Boolean = mThread.Start(Me, "Import_Data", Array As Object(aBO)) end sub Private Sub Import_Data (aParam As Object ) try Catch Log(LastException) End Try end sub
HI All I created a thread for a procedure a bit long. I see that in the case of exception, does not return the message in the log. how can I do? thanks Code: Copy private sub Import Dim mThread As Thread mThread.Initialise("Thread1") Dim aOk As Boolean = mThread.Start(Me, "Import_Data", Array As Object(aBO)) end sub Private Sub Import_Data (aParam As Object ) try Catch Log(LastException) End Try end sub
Roberto P. Well-Known Member Licensed User Longtime User Mar 10, 2017 #2 AndOrNot said: You never enter in catch, because there are not actions in try Click to expand... There are procedures that I have not specified! Upvote 0
AndOrNot said: You never enter in catch, because there are not actions in try Click to expand... There are procedures that I have not specified!
Erel B4X founder Staff member Licensed User Longtime User Mar 12, 2017 #3 Why do you need to create another thread? Can you post the Import_Data code? Upvote 0
Roberto P. Well-Known Member Licensed User Longtime User Mar 12, 2017 #4 Erel said: Why do you need to create another thread? Can you post the Import_Data code? Click to expand... I need another thread because I need to perform a data recalculation procedure (which does not reproduce because it has no effect on the problem) that blocks the main thread for too long time and blocking the App. with another thread I solved the blocking issue, but in the case of error canno't I see in the log. thank you Upvote 0
Erel said: Why do you need to create another thread? Can you post the Import_Data code? Click to expand... I need another thread because I need to perform a data recalculation procedure (which does not reproduce because it has no effect on the problem) that blocks the main thread for too long time and blocking the App. with another thread I solved the blocking issue, but in the case of error canno't I see in the log. thank you
Erel B4X founder Staff member Licensed User Longtime User Mar 13, 2017 #5 I recommend you to try to avoid using the Threading library. Whether it is possible or not depends on the actual procedure. Upvote 0
I recommend you to try to avoid using the Threading library. Whether it is possible or not depends on the actual procedure.
Roberto P. Well-Known Member Licensed User Longtime User Mar 13, 2017 #6 Hi Erel There is another way to perform the procedure in the background without blocking the main application process? Upvote 0
Hi Erel There is another way to perform the procedure in the background without blocking the main application process?
Erel B4X founder Staff member Licensed User Longtime User Mar 13, 2017 #7 Whether it is possible or not depends on the actual procedure. Upvote 0
Roberto P. Well-Known Member Licensed User Longtime User Mar 13, 2017 #8 The procedure works in the background and can take a long time to process data, this causes blockage of the application until it completes processing. I hope it is clear. thanks Upvote 0
The procedure works in the background and can take a long time to process data, this causes blockage of the application until it completes processing. I hope it is clear. thanks
Erel B4X founder Staff member Licensed User Longtime User Mar 13, 2017 #9 It is clear. Maybe it can be optimized. However we can only help you if you provide more information. Upvote 0
It is clear. Maybe it can be optimized. However we can only help you if you provide more information.