How can I programmatically set the gadget state of a combo box based not on the ordinal position of the item's row but on the value of the item's underlying data?
i.e.: I have a combo box showing Status descriptions which are fetched from a an HTTPRequest call to a web service API
For example:
Row 0 has text "Draft" and underlying data of 1
Row 1 has text "Staging" and underlying data of 2
Row 2 has text "Live" and underlying data of 3
Row 3 has text "Stopped" and underlying data of 4
Row 4 has text "Amended" and underlying data of 5
As far as I can tell, I can only use SetGadgetState() to set the selected row based on its position (eg row 0, row 1, row 99 etc). There does not appear to be a keyword to set the selected row based on the underlying data - is this correct? Do I need to loop through the combo box each time and compare the data to the value I want to set it to?
Note: the data may change so I do not want to set any constants or use other hard coding at the SpiderBasic end of things. So for example I cannot make the assumption that the row number I want is Status ID - 1 .
Thanks in advance for any help
