Maplets[Tools] - Maple Programming Help

Home : Support : Online Help : Programming : Maplets : Tools : Maplets/Tools/ListBoxSplit

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}[\mathrm{Elements}]\right):$
 > $\mathrm{maplet}≔\mathrm{Maplet}\left(\left[\left["Pick your favorite Canadian capital\left(s\right):",\mathrm{ListBox}['\mathrm{LB1}']\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}[\mathrm{Display}]\left(\mathrm{maplet}\right):$
 > $\mathbf{if}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{type}\left(\mathrm{result},\left['\mathrm{string}'\right]\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{then}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{Maplets}[\mathrm{Tools}][\mathrm{ListBoxSplit}]\left({\mathrm{result}}_{1}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end if}$

Assume the user selects Victoria and Halifax:

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