I thought of something else.
Make the listbox 1 based.
Currently countgadgetitems can return 0 for none. But selectedgadgetitem can't return a value for "none selected" as 0, is counted as the first item. Yes you can do if countgadgetitems(...) = 0, but that is not sensible.
Make the listbox 1 based.
Currently countgadgetitems can return 0 for none. But selectedgadgetitem can't return a value for "none selected" as 0, is counted as the first item. Yes you can do if countgadgetitems(...) = 0, but that is not sensible.