KutPax 0 Posted January 15, 2021 Heya, I'm working on a GUI with a RscCombo box, only I'm getting an error. This is my code: _display displayAddEventhandler ["Unload", { params ["_display"]; private _ctrlEdit13 = _display displayCtrl 6901; missionNamespace setVariable ["Snake_enteredText13", lbCurSel _ctrlEdit13, true]; }]; _ctrlEdit13 = _display displayCtrl 6901; _ctrlEdit13 lbSetCurSel (missionNamespace getVariable ["Snake_enteredText13", ""]);This is the error: Error lbSetCurSel: Type String, expected number If anyone knows a fix to this, please do let me know. I'd be very grateful! Share this post Link to post Share on other sites
gc8 977 Posted January 15, 2021 you are giving lbSetCurSel a string, but it needs a number. number meas which combobox item is selected Share this post Link to post Share on other sites
KutPax 0 Posted January 15, 2021 The problem is I don't have a number. Any idea on how I can fix that? Share this post Link to post Share on other sites
Larrow 2820 Posted January 15, 2021 20 minutes ago, KutPax said: The problem is I don't have a number. Any idea on how I can fix that? So 0, default to the first thing in the combo. Share this post Link to post Share on other sites
gc8 977 Posted January 15, 2021 20 minutes ago, KutPax said: The problem is I don't have a number. Any idea on how I can fix that? see the getvariable default parameter here ("") : _ctrlEdit13 lbSetCurSel (missionNamespace getVariable ["Snake_enteredText13", ""]); change it to: _ctrlEdit13 lbSetCurSel (missionNamespace getVariable ["Snake_enteredText13", 0]); now zero is your default number Share this post Link to post Share on other sites
KutPax 0 Posted January 15, 2021 Wow, I tried something like that, but didn't realise I put the 0 between "". Anyways, it worked1 Thanks my dude Share this post Link to post Share on other sites