svanneste Member Licensed User Oct 1, 2020 #1 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 Code: Copy 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
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 Code: Copy 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
svanneste Member Licensed User Oct 1, 2020 #2 Found it here in the spoiler : https://www.b4x.com/android/forum/t...e-powerful-local-datastore.63633/#post-402376 Code: Copy Wait For (kvs1.PutMapAsync(CreateMap("U1":"P1","U2":"p2","U3":"p3"))) Complete Very hard to find the event. Is there any way to find the events without searching the forums ? Thanks Upvote 0
Found it here in the spoiler : https://www.b4x.com/android/forum/t...e-powerful-local-datastore.63633/#post-402376 Code: Copy Wait For (kvs1.PutMapAsync(CreateMap("U1":"P1","U2":"p2","U3":"p3"))) Complete Very hard to find the event. Is there any way to find the events without searching the forums ? Thanks
Erel B4X founder Staff member Licensed User Longtime User Oct 2, 2020 #3 It was missing in the internal documentation. I will add it. It should be: Code: Copy Wait For (kvs1.PutMapAsync(CreateMap("U1":"P1","U2":"p2","U3":"p3"))) Complete (Success As Boolean) svanneste said: Is there any way to find the events without searching the forums ? Thanks Click to expand... 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. Last edited: Oct 2, 2020 Upvote 0
It was missing in the internal documentation. I will add it. It should be: Code: Copy Wait For (kvs1.PutMapAsync(CreateMap("U1":"P1","U2":"p2","U3":"p3"))) Complete (Success As Boolean) svanneste said: Is there any way to find the events without searching the forums ? Thanks Click to expand... 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.
svanneste Member Licensed User Oct 2, 2020 #4 Thanks a lot for the details. I really appreciate. Thanks again. ? Upvote 0