Dialog
✖
Dialog
Details and Options

- Dialog creates a dialog that consists of a sequence of input and output lines.
- You can exit a dialog using Return.
- With the global setting $IgnoreEOF=False, you can also exit a dialog by entering an end‐of‐file character.
- If you exit with Return[expr], then expr is the value returned by the Dialog function. Otherwise, the value returned is the expression on the last output line in the dialog.
- Dialog automatically localizes the values of $Line, $MessageList, and $Epilog.
- Dialog initially sets the local value of $Line to be equal to its global value. This means that the numbering of input and output lines in the dialog follows the sequence outside the dialog. When the dialog is exited, however, the numbering reverts to the sequence that would be followed if there had been no dialog.
- Any local value assigned to $Epilog is evaluated when the dialog is exited.
- The main loop within a dialog uses global variables such as $Pre and $Post.
- The option DialogSymbols:>{x,y,…} sets up local values for variables within the dialog. DialogSymbols:>{x=x0,…} defines initial values for the variables.
- The option DialogProlog:>expr specifies an expression to evaluate before starting the dialog.
- Dialog first localizes variables, then evaluates any expression specified by DialogProlog, then evaluates any argument you have given for Dialog.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
To evaluate this expression, the Wolfram System initiates a dialog:

https://wolfram.com/xid/0dej0y-d0st3o

Computations can be done within the dialog just like an ordinary Wolfram System session:

https://wolfram.com/xid/0dej0y-bf78mx
Return from the dialog. The value is inserted in the original expression to get Out[1]:

https://wolfram.com/xid/0dej0y-kzagy
Scope (1)Survey of the scope of standard use cases
Run a dialog each time through a loop:

https://wolfram.com/xid/0dej0y-5su29
You can see the current value of the loop variable i in the dialog:

https://wolfram.com/xid/0dej0y-jvsvm

Return from the first dialog. x is multiplied by the current value of i:

https://wolfram.com/xid/0dej0y-f3vodw
The current values of i and x:

https://wolfram.com/xid/0dej0y-iazae4

Return from the second dialog. x is multiplied by the current value of i squared:

https://wolfram.com/xid/0dej0y-l2tm

https://wolfram.com/xid/0dej0y-dtggnt
The value of x after the loop:

https://wolfram.com/xid/0dej0y-kmhb6f

Wolfram Research (1991), Dialog, Wolfram Language function, https://reference.wolfram.com/language/ref/Dialog.html.
Text
Wolfram Research (1991), Dialog, Wolfram Language function, https://reference.wolfram.com/language/ref/Dialog.html.
Wolfram Research (1991), Dialog, Wolfram Language function, https://reference.wolfram.com/language/ref/Dialog.html.
CMS
Wolfram Language. 1991. "Dialog." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Dialog.html.
Wolfram Language. 1991. "Dialog." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Dialog.html.
APA
Wolfram Language. (1991). Dialog. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Dialog.html
Wolfram Language. (1991). Dialog. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Dialog.html
BibTeX
@misc{reference.wolfram_2025_dialog, author="Wolfram Research", title="{Dialog}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/Dialog.html}", note=[Accessed: 09-July-2025
]}
BibLaTeX
@online{reference.wolfram_2025_dialog, organization={Wolfram Research}, title={Dialog}, year={1991}, url={https://reference.wolfram.com/language/ref/Dialog.html}, note=[Accessed: 09-July-2025
]}