The ShowListCommand Object

The ShowListCommand object is used like the ShowList object to indicte that a list of expressions returned by a command should be shown in the autocomplete popup. The difference between this object and the ShowList object is that the expression selected from the result list is passed to a second command along with the expression that is highlighted. This is used, for example, to apply a different style to bulleting. You select from a list of bulleting styles then a second command is used to apply the bulleting style to the highlighted expression(s).

The ShowListCommand object is defined to be a three parameter object. The expression in the first parameter will be substituted for the highlighted term (it can be the same as the highlighted term), the expression in the second parameter will typically be a list of results that are displayed in the autocomplete popup. The expression in the third parameter will be the command that should be executed after a selection is made from the result list.

The ToShowListCommand function can be used to create an instance of the ShowListCommand object. If there is only one item in the list of options, the ToShowListCommand function will just execute the command in the third parameter, passing in the single result from the original command.

The ShowListCommand object is used in commands like the Question command and the Convert command.