RepeatingElement

RepeatingElement[spec]

represents an arbitrarily repeated type of element in an interpreter, API or form specification.

RepeatingElement[spec,max]

represents an element that can appear at most max times.

RepeatingElement[spec,{min,max}]

represents an element that can appear between min and max times.

RepeatingElement[spec,{n,{min,max}}]

represents an element that initially appears n times in a form.

RepeatingElement[spec,{{i,n},{min,max}}]

represents an element where i takes successive values.

Details

Examples

open allclose all

Basic Examples  (5)

RepeatingElement can be used in FormFunction to repeat a field:

In[1]:=
Click for copyable input

RepeatingElement fields can also be filled programmatically:

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

In an APIFunction, RepeatingElement specifies that all instances of a particular parameter should be used:

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

Without RepeatingElement, only the last instance is used:

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

Interpreter threads over lists, so RepeatingElement is not needed here:

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

This interprets lists containing a single integer and a repeating list of integers:

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

RepeatingElement can be used to limit the number of elements:

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

Scope  (3)

Properties & Relations  (4)

Possible Issues  (1)

See Also

CompoundElement  DelimitedSequence  RectangularRepeatingElement  SquareRepeatingElement  Interpreter  Repeated  FormFunction

Introduced in 2015
(10.1)