I have been using Application.ShowFormInDialog to display dialogs so users can choose items. After closing, the calling script continues running from the line after the call, as expected.
The forms I was showing have gotten more complicated during the last few days – have added a number of tab panels… have also hidden the calls to Application.ShowFormInDialog in module methods.
My code no longer blocks while waiting for user input.
Typical scenario:
Script A calls
Script B in module calls
Application.ShowFormInDialog
Looks like Script B blocks, while Script A continues running…
No, it is more complicated than that – difficult to explain
I think the dialogs fails to block when someone use deeply nested method calls. I’m hiding all generic logic in modules to so it can be shared between mutiple projects. The window in the screenshot has a number of nested tabpanels – but to define it I only have to attach one global method Shows the power of Servoy…
But I have found a workaround to the non-block problem, use simple recursion:
globals.acc_choose_book calls a generic method in a module.
lookup_other is now recursive, since I now call globals.acc_choose_book with two extra parameters at the end:
‘lookup_other’ is the method I want to resume
1 is a flag to determine where I want to restart