Hi,
Please how to use Wait For with KVS.PutMapAsync ? I can not find how to write it (below attached what I thought I had to write). Thanks
B4X:
Dim kvs1 As KeyValueStore
kvs1.Initialize(File.DirApp,"users") 'Example played on B4J
kvs1.PutMapAsync(CreateMap("U1":"p1","U2":"p2","U3":"p3"))
Wait For(kvs1) kvs1_Terminated(kvs1 As KeyValueStore)
Log("Finished")
kvs1.Close
There are two types of "events" that can be caught with Wait For:
1. Regular events where Wait For is an alternative to an event sub. There are many ways to see these events signatures and the best one is to write space followed by tab.
2. [B4X] Resumable subs that return values (ResumableSub) . This is the case here. The event name will always be Complete, and it has a single parameter. The compiler doesn't know the parameter type so it must be documented.