G GuyBooth Active Member Licensed User Longtime User Jan 25, 2019 #1 Code I am trying to run that reads a music file seems to be time sensitive - I am assuming for now that it takes too long to read the information and pass it back to its calling sub, which leads to inconsistent results. The line of code is: Code: Copy HasField = TagSet.RunMethod("hasField", Array(Field)) If HasField Then TagValue = TagSet.runmethod("getFirst", Array(Field)) ... etc Is it possible to use runmethod asynchronously, using statements like the following: Code: Copy Wait For (TagSet.RunMethod("hasField", Array(Field))) Complete (HasField As Boolean) Log($"HasField ${Field} is ${HasField}"$) If HasField Then Wait For (TagSet.RunMethod("getFirst", Array(Field))) Complete (TagValue As String) ... etc I have tried the Wait For statements as shown but the program just stops and waits at the first Wait For statement.
Code I am trying to run that reads a music file seems to be time sensitive - I am assuming for now that it takes too long to read the information and pass it back to its calling sub, which leads to inconsistent results. The line of code is: Code: Copy HasField = TagSet.RunMethod("hasField", Array(Field)) If HasField Then TagValue = TagSet.runmethod("getFirst", Array(Field)) ... etc Is it possible to use runmethod asynchronously, using statements like the following: Code: Copy Wait For (TagSet.RunMethod("hasField", Array(Field))) Complete (HasField As Boolean) Log($"HasField ${Field} is ${HasField}"$) If HasField Then Wait For (TagSet.RunMethod("getFirst", Array(Field))) Complete (TagValue As String) ... etc I have tried the Wait For statements as shown but the program just stops and waits at the first Wait For statement.
Erel B4X founder Staff member Licensed User Longtime User Jan 27, 2019 #2 No. Wait For has nothing to do with background threads. A relevant example: https://www.b4x.com/android/forum/threads/advertising-id.101050/#content Upvote 0
No. Wait For has nothing to do with background threads. A relevant example: https://www.b4x.com/android/forum/threads/advertising-id.101050/#content