AskAppend

AskAppend["key"]

is a construct for use inside AskFunction that asks for a new value, appends it to the current value associated with "key", and returns the resulting list.

AskAppend["key"formspec]

uses formspec to define how input should be requested and interpreted.

Details

  • If there is no value yet associated with "key", AskAppend will put the new value it obtains in a list.
  • Executing AskAppend again with the same key will append each new value to the list associated with the key.
  • If there is an existing value associated with "key" that was obtained from Ask, AskAppend will put this value in a list before appending a new value.

Examples

open allclose all

Basic Examples  (2)

Ask a question several times, appending each answer to a list:

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

Use AskAppend to accumulate inputs:

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

Properties & Relations  (2)

See Also

Ask  AskConfirm  AskFunction  AppendTo  Sow

Introduced in 2016
(10.4)