Finally Understanding RunDialog

NOTE: I just made a small but important change to the illustrations the OK button. I have created many dialogs with the rundialog statement, but every time there is a lot of trial and error because fundamentally I did not understand what was going on, even though I read the Help pages several times. Finally, I used zlog with embedded statements to figure out what rundialog is doing, when does the loop pause, and what is happening with the trigger. Having done that, the Help page makes a lot more sense. You can see that the rundialog code is changing the trigger at the start of each loop and deciding whether to pause at the end of the pass. I created some graphics to illustrate what I have figured out and thought I would share it with others in case someone might find this useful.
I have a simple code with a rundialog loop and three buttons on the form, Ok, Cancel, and Other. Here are three illustrations that show the whole sequence when you run the code and when you press each of the buttons. The dialog is on the third page. (OK button illustration was revised slightly on 2/18/22)

1 Like