AskConfirm
✖
AskConfirm
is a construct for use inside AskFunction that asks for confirmation of the current value associated with "key" and allows this to be either confirmed or changed.
Details

- AskConfirm returns the value associated with "key" when confirmation was accepted.
- If confirmation is not accepted, AskConfirm["key"] effectively rewinds evaluation inside an AskFunction back to the previous time a value for "key" was requested.
- In the context of the second argument of AskConfirm, the StringTemplate is applied with the association <"key"->key, "value"->value >.
- AskConfirm["key"] is typically equivalent to AskConfirm["key","The current value of key `key` is `value`. Do you want to change it?"].
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
AskConfirm can be used to rewind the evaluation to the point before a value was known:

https://wolfram.com/xid/0dqwa5khgny-kvyk7k

Confirm the user's answer with a custom message:

https://wolfram.com/xid/0dqwa5khgny-fjirti

Confirm the user's answer if it seems unlikely:

https://wolfram.com/xid/0dqwa5khgny-t5z00l

Properties & Relations (1)Properties of the function, and connections to other functions
AskConfirm can be simulated by unsetting the value associated with a key:

https://wolfram.com/xid/0dqwa5khgny-q9lvi5

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