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 keyi should be asked for.

Details and Options

  • 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 "keyk" is taken to be inputk.

Examples

open allclose all

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]=

Scope  (3)

Properties & Relations  (7)

Possible Issues  (1)

See Also

Ask  FormFunction  Input  AskAppend  AskConfirm  AskedValue  AskDisplay  AskTemplateDisplay  AskState  AskedQ  CloudDeploy

Introduced in 2016
(10.4)