Maybe such a function should need some test ...
Function SelectedGadgetItemText:String(Gadget:TGadget)
Local lId:Int = SelectedGadgetItem(Gadget)
If lId>-1 Return GadgetItemText(Gadget, lId)
Return ""
End Function
Like this, you can specify an empty ListBox/Combobox without getting Error on index