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:
Is it possible to use runmethod asynchronously, using statements like the following:
I have tried the Wait For statements as shown but the program just stops and waits at the first Wait For statement.
The line of code is:
B4X:
HasField = TagSet.RunMethod("hasField", Array(Field))
If HasField Then
TagValue = TagSet.runmethod("getFirst", Array(Field))
... etc
B4X:
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