ecl-logo Documentation

GenerateInputPattern

GenerateInputPattern[myWidget]pattern

returns a pattern that is consistent with myWidget.

GenerateInputPattern[myOptionsList]pattern

returns a pattern for an option that is consistent with myOptionsList.

GenerateInputPattern[myInputsList]pattern

returns a pattern for an input that is consistent with myInputsList.

Details

    Input
    Output
    System Options
    Messages
  • AllowNullThe value of AllowNull in the options list needs to match BooleanP. Please reformat your input.
    InvalidWidgetThe given widget, `1`, does not match WidgetP. Please reformat your input.
    MainUnitNotProvidedInUnitsListIn the atomic WidgetUnit `1`, the main unit `2` is not contained within the other unit list `3`. Please add this unit to the full list of units.
    MissingRequiredKeyUnable to build a pattern for the given input/options packet or widget, `1`, because a required key is missing. For options, the required keys are {OptionName, Default, AllowNull, Description}. For input, the required keys are {InputName, Description, Widget}. Please include these required keys. For a widget, run ValidWidgetQ.

Examples

Basic Examples  (5)

Build a pattern for an options list:

Build a pattern for an input list:

Build a pattern for a quantity widget:

Build a pattern for an adder widget:

Build a pattern for a widget unit:

Additional Examples  (7)

Build a pattern for an alternatives widget:

Build a pattern for an alternatives widget (with labels):

Build a pattern for a tuples widget:

Build a pattern for an enumeration widget:

Build a pattern for a span widget:

Build a pattern for a very nested widget:

Create a pattern for an atomic WidgetUnit:

Options  (1)

Tooltips  (1)

Build a pattern for a tuples widget with Tooltips:

Messages  (4)

AllowNull  (1)

AllowNull must match BooleanP if an option list is provided:

InvalidWidget  (1)

A pattern cannot be built if the given widget is invalid:

MainUnitNotProvidedInUnitsList  (1)

Returns $Failed if the main unit is not contained in the units list, for an atomic WidgetUnit:

MissingRequiredKey  (1)

Returns $Failed if a required key is missing from an options packet. In this example the OptionName key is missing: