c.haslam Posted August 15 Share Posted August 15 (edited) Early in my script I have: $cmbEDOW = GUICtrlCreateCombo("", 120, 71, 81, 25, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, "Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday","Sunday") Later in my script the user can change the day of the week to a different one, e.g. s being "Friday", so I have: Local $t = "Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday" GUICtrlSetData($cmbEDOW,$t,s) But when the user clicks on the control he sees 15 choices, Sunday .. Saturday is repeated and a third Sunday is added at the end. I have tried setting data to "". It doesn't help. Edited August 15 by c.haslam Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard Link to comment Share on other sites More sharing options...
c.haslam Posted August 15 Author Share Posted August 15 I could not edit, so here is corrected version: Early in my script I have: $cmbEDOW = GUICtrlCreateCombo("", 120, 71, 81, 25, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, "Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday","Sunday") Later in my script the script changes the day of the week to a different one, e.g. s being "Friday", so I have: Local $t = "Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday" GUICtrlSetData($cmbEDOW,$t,s) But when the user clicks on the control he sees 15 choices, Sunday .. Saturday is repeated and a third Sunday is added at the end. I have tried setting data to "". It doesn't help. Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard Link to comment Share on other sites More sharing options...
ahmet Posted August 15 Share Posted August 15 Under remarks for GUICtrlSetData() there is this line: "If the "data" starts with GUIDataSeparatorChar or is an empty string "" the previous list is destroyed. A trailing GUIDataSeparatorChar is ignored." So your "later" line should be Local $t = "|Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday" Link to comment Share on other sites More sharing options...
c.haslam Posted August 15 Author Share Posted August 15 Thank you. I now understand "If the "data" starts with GUIDataSeparatorChar ... the previous list is destroyed". "If the "data" starts with GUIDataSeparatorChar ... the previous list is destroyed and the list that followings the GuiDataSeparatorChar replaces the old list" would be clearer. I don't see how "data" being "an empty string" would be useful. Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard Link to comment Share on other sites More sharing options...
Andreik Posted August 15 Share Posted August 15 38 minutes ago, c.haslam said: I don't see how "data" being "an empty string" would be useful. It's useful to clear the combo in order to add new data without being appended to the current data or simply for the cases where you want to clear all data. Link to comment Share on other sites More sharing options...
Solution c.haslam Posted August 16 Author Solution Share Posted August 16 Understood Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now