Maffe811 Posted July 19, 2012 Posted July 19, 2012 I know there is a simple way of making this: _GUICtrlComboBox_SetCurSel($Switch_Combo_Hotkey, 0) $StringCount = _GUICtrlComboBox_GetCount($Switch_Combo_Hotkey) _GUICtrlComboBox_DeleteString($Switch_Combo_Hotkey, $StringCount - 1) _GUICtrlComboBox_SetCurSel($Prog1_Combo_Hotkey, 0) $StringCount = _GUICtrlComboBox_GetCount($Prog1_Combo_Hotkey) _GUICtrlComboBox_DeleteString($Prog1_Combo_Hotkey, $StringCount - 1) _GUICtrlComboBox_SetCurSel($Prog2_Combo_Hotkey, 0) $StringCount = _GUICtrlComboBox_GetCount($Prog2_Combo_Hotkey) _GUICtrlComboBox_DeleteString($Prog2_Combo_Hotkey, $StringCount - 1) Something like this: For $i = 1 to $Array[0] step 1 _GUICtrlComboBox_SetCurSel($Array[$i], 0) $StringCount = _GUICtrlComboBox_GetCount($Array[$i]) _GUICtrlComboBox_DeleteString($Array[$i], $StringCount - 1) Next [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]
czardas Posted July 19, 2012 Posted July 19, 2012 Yes something like that. You don't need to state Step 1 because For loops do that by default. If you want to step a different interval either positive or negative, that's when you need to use Step $nval. So is your code not working? operator64 ArrayWorkshop
Maffe811 Posted July 19, 2012 Author Posted July 19, 2012 So is your code not working? No, its not. $Array = StringSplit("$Switch_Combo_Hotkey|$Prog1_Combo_Hotkey|$Prog2_Combo_Hotkey","|") For $i = 1 to $Array[0] step 1 _GUICtrlComboBox_SetCurSel($Array[$i], 0) $StringCount = _GUICtrlComboBox_GetCount($Array[$i]) _GUICtrlComboBox_DeleteString($Array[$i], $StringCount - 1) Next To me, this should do what the code in my first post do, except it doesn't. What i'm i doing wrong? You don't need to state Step 1 because For loops do that by default. I know, i just got a habbit of stating it. [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]
iamtheky Posted July 20, 2012 Posted July 20, 2012 (edited) you are doing _guictrlcombo actions on the array? are you just trying to delete it out of the combo like so: #include #Include $Array = StringSplit("$Switch_Combo_Hotkey|$Prog1_Combo_Hotkey|$Prog2_Combo_Hotkey","|") _ArrayDisplay ($Array) $hGUI = GUICreate("(UDF) ComboBox Create", 400, 296) $hCombo = _GUICtrlComboBox_Create($hGUI, "", 2, 2, 396, 296) GUISetState() sleep (1000) For $i = 1 to $Array[0] _GUICtrlComboBox_BeginUpdate($hCombo) _GUICtrlComboBox_AddString($hCombo, $Array[$i]) _GUICtrlComboBox_EndUpdate($hCombo) sleep (1000) Next sleep (1000) For $i = 1 to $Array[0] _GUICtrlComboBox_SetCurSel($hcombo, 0) $StringCount = _GUICtrlComboBox_GetCount($hcombo) _GUICtrlComboBox_DeleteString($hcombo, $StringCount - 1) sleep (1000) Next Edited July 20, 2012 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
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