Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

AskedValue

AskedValue["key"]
is a construct for use inside AskFunction that gives the value associated with key, or Missing[] if none has been provided.

DetailsDetails

  • If a value has already been associated with a key, AskedValue returns that value just like Ask. But unlike Ask, AskedValue will never request a value from the user, instead returning Missing[] if no value has yet been provided.
  • When no value is yet known for the requested key, AskedValue["key"] returns Missing["NotAsked","key"].

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

AskedValue returns the value whenever it is already known:

In[1]:=
Click for copyable input
Out[1]=

But returns missing whenever it is not known yet:

In[2]:=
Click for copyable input
Out[2]=

AskedValue returns the value without causing a form to be displayed:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2016
(10.4)