Wolfram Language & System 10.4 (2016)|Legacy Documentation

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

AskFunction

AskFunction[body]
evaluates body, interactively asking for values specified by Ask[] and related constructs.

AskFunction[{"key1"spec1,"key2"spec2,},body]
specifies how values associated with the should be asked for.

DetailsDetails

  • The following special constructs can appear in the body of an AskFunction:
  • Ask[]ask for the value of a key if not already known
    AskedValue[]get the value of a key if it is known
    AskAppend[]ask for a value and append it to the list of known values
    AskConfirm[]confirm or change a value
    AskDisplay[]display an expression with asked values inserted
    AskTemplateDisplay[]display a template applied to the asked values
    AskedQ[]test if the value of a key has been asked for
  • AskFunction[][] evaluates in a notebook, displaying a form every time it encounters a construct that requires asking for a value.
  • CloudDeploy[AskFunction[]] yields a CloudObject corresponding to an active version of the AskFunction.
  • AskFunction[][<|"keyk"->inputk|>] represents an AskFunction where the value associated with is taken to be .

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Set up an AskFunction:

In[1]:=
Click for copyable input

Activate it and fill in the inputs:

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

Or deploy it to the cloud:

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

You can programmatically provide known values:

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

Now only the second question will be asked:

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