In mirc you type /help dialogs and find the following paragraph:

Quote:
Variables
If you specify a %variable name in a dialog item definition, the %variable will be set with the contents of that item when the dialog is closed.