Wish Autocomplete Event names with Wait For

Creideiki

Active Member
Licensed User
Longtime User
Hi,
I had a bad time searching for a bug where the program logic hung. It turned out I wrote
B4X:
Wait For Msgbox_Respond (...)
instead of
B4X:
Wait For Msgbox_Result (...)

Same problem when I used
B4X:
Wait For JobComplete ...
instead of
B4X:
Wait For JobDone ...

The problem is that neither the IDE nor the compiler warn about that, but it's a show stopper and very hard to find if you simply have a little typo in your code.

I would really like it very much if the IDE could show me the events that are possible with Wait For at a specific call.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The IDE autocompletes the standard events.
SxCrMJ72Uz.gif


MsgboxAsync2 event is non-standard. Don't try to guess it. Copy it from the help window:

1605427935092.png


JobDone is also non-standard (due to historic reasons).
 

Creideiki

Active Member
Licensed User
Longtime User
Hm, ok... but IMHO it's better to use real event handler subs for events like the Click event. I never used Wait For this far. Mostly I use it for Msgboxes and other dialog boxes and, as the reality shows, I am able to use the wrong event even for that... (two times of some dozens in this case).

My main issue would be a verification by the IDE or compiler if the used event even exists. This would prevent typos. Would that be possible?
 
Top