List Box Split - Maple Help

Home : Support : Online Help : Programming : Maplets : Tools : List Box Split

Maplets[Tools]

 ListBoxSplit
 convert the value of a ListBox to a list of strings

 Calling Sequence ListBoxSplit(x)

Parameters

 x - value of a ListBox

Description

 • The ListBoxSplit(x) calling sequence converts a list box value to a list of strings.

Examples

 > $\mathrm{with}\left(\mathrm{Maplets}\left[\mathrm{Elements}\right]\right):$
 > $\mathrm{maplet}≔\mathrm{Maplet}\left(\left[\left["Pick your favorite Canadian capital\left(s\right):",\mathrm{ListBox}\left['\mathrm{LB1}'\right]\left(\mathrm{sort}\left(\left["Ottawa, ON","Victoria, BC","Edmonton, AB","Regina, SK","Winnipeg, MB","Toronto, ON","Quebec City, QC","Fredericton, NB","Halifax, NS","Charlottetown, PE","St. John\text{'}s, NL","Whitehorse, YT","Yellowknife, NT","Iqaluit, NU"\right],\mathrm{lexorder}\right)\right)\right],\left[\mathrm{Button}\left("OK",\mathrm{Shutdown}\left(\left['\mathrm{LB1}'\right]\right)\right),\mathrm{Button}\left("Cancel",\mathrm{Shutdown}\left(\right)\right)\right]\right]\right):$
 > $\mathrm{result}≔\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right):$
 > $\mathbf{if}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{type}\left(\mathrm{result},\left['\mathrm{string}'\right]\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{then}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{Maplets}\left[\mathrm{Tools}\right]\left[\mathrm{ListBoxSplit}\right]\left(\mathrm{result}\left[1\right]\right)\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{if}$

Assume the user selects Victoria and Halifax:

 > $\mathrm{Maplets}\left[\mathrm{Tools}\right]\left[\mathrm{ListBoxSplit}\right]\left("Victoria, BC,Halifax, NS"\right)$
 $\left[{"Victoria, BC"}{,}{"Halifax, NS"}\right]$ (1)