# listbox

Displays a list box, and ask an item to user.

    listbox <message> <title> <string array>

## Parameters

string <message>
  It is displayed in the list box.
string <title>
  It is displayed as the list box title.
array<string array>
  It is displayed as the list box items.

## Return Value

System variable <result>
  If the user selects one of items, it is set to from 0 to N-1.
  If the user cancels, it is set to -1.

## Remarks

The listbox macro command shows all selected items of the <string array> array.
If the <string array> is defined as bigger entries than selected nums as follows, the empty string will be shown at last.

    strdim msg 4
    msg[0] = 'Banana'
    msg[1] = 'Apple'
    msg[2] = 'Orange'
    listbox 'Select your favorite food.' 'Confirmation' msg

    ; displays 4 items
    Banana
    Apple
    Orange
    [Enpty string]

## Example

    strdim msg 3
    msg[0] = 'Banana'
    msg[1] = 'Apple'
    msg[2] = 'Orange'
    listbox 'Select your favorite food.' 'Confirmation' msg
    sprintf2 var "%d" result
    messagebox var "result"
    ; result
    ;   -1: Cancel
    ;    0: Banana
    ;    1: Apple
    ;    2: Orange

## See also

- yesnobox