LISTBOXGETSELECT

Synopsis
LISTBOXGETSELECT name
Description

Outputs the selected item within the listbox that is identified by name. The output is a list, as if the text of the currently selected row were parsed by PARSE. If nothing is selected, then LISTBOXGETSELECT outputs the empty list.

Example
TO DODRAW
  CLEARSCREEN
  IF EQUALP [Triangle] LISTBOXGETSELECT "mylist [REPEAT 3 [FORWARD 100 RIGHT 120]]
  IF EQUALP [Square]   LISTBOXGETSELECT "mylist [REPEAT 4 [FORWARD 100 RIGHT 90]]
END

WINDOWCREATE "main "mywindow "mytitle 0 0 100 100 []
LISTBOXCREATE "mywindow "mylist 25 0 50 50
LISTBOXADDSTRING "mylist [Triangle]
LISTBOXADDSTRING "mylist [Square]
BUTTONCREATE "mywindow "mydraw "Draw 25 50 50 25 [DODRAW]

Select an item from the listbox and then click the Draw button.

WINDOWDELETE "mywindow

SourceForge.net Logo