Greetings fellow newbies and pros!
So I've been looking for answers the whole evening, but couldn't find any that fit my problem.
Basically it is pretty basic, but somehow I can't get it to work.
Anyway, here it goes:
My parameters $Location, $Infection and $Difficulty are specified in ComboBoxes in the first Function. When
the button is pressed I want to pass them to the next Function. They are however not passed as far as i can tell.
Heres my code, and I appreciate every helpful comment
Go nuts!
So I've been looking for answers the whole evening, but couldn't find any that fit my problem.
Basically it is pretty basic, but somehow I can't get it to work.
Anyway, here it goes:
My parameters $Location, $Infection and $Difficulty are specified in ComboBoxes in the first Function. When
the button is pressed I want to pass them to the next Function. They are however not passed as far as i can tell.
Heres my code, and I appreciate every helpful comment
Go nuts!
[ autoit ]
Choose() Func Choose() $gui = GUICreate("StartUp", 120, 220, 750, 300) $label_combo_infection = GUICtrlCreateLabel("Choose Infection:", 11, 25, 100, 20) $combo_choose_infection = GUICtrlCreateCombo("Bacteria", 10, 45, 100, 0,$CBS_DROPDOWNlist + $CBS_AUTOHSCROLL) $combo_populate_choose_infection = GUICtrlSetData($combo_choose_infection, "Virus|Fungus|Nano Bots|Bio Weapon|Parasite|Alien Worm") $label_combo_difficulty = GUICtrlCreateLabel("Choose Difficulty:", 11, 75, 100, 20) $combo_choose_difficulty = GUICtrlCreateCombo("Casual", 10, 95, 100, 0, $CBS_DROPDOWNlist + $CBS_AUTOHSCROLL) $combo_populate_choose_difficulty = GUICtrlSetData($combo_choose_difficulty, "Normal|Hard|Apocalyptic|Mastermind") $label_combo_location = GUICtrlCreateLabel("Choose Location:", 11, 125, 100, 20) $combo_choose_location = GUICtrlCreateCombo("Afghanistan", 10, 145, 100, 0, $CBS_DROPDOWNlist + $CBS_AUTOHSCROLL) $combo_populate_choose_location = GUICtrlSetData($combo_choose_location, $locations) $button_start = GUICtrlCreateButton("Begin", 10, 175, 100, 30) GUISetState(@SW_SHOW, $gui) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $button_start $Infection = _GUICtrlComboBox_GetEditText($combo_choose_infection) $Difficulty = _GUICtrlComboBox_GetEditText($combo_choose_difficulty) $Location = _GUICtrlComboBox_GetEditText($combo_choose_location) Game($Infection, $Difficulty, $Location) GUIDelete($gui) EndSwitch WEnd EndFunc Func Game($Infection, $Difficulty, $Location) $gui_game = GUICreate("Pandemic", 1300, 900, 200, 50) $preferences_label = GUICtrlCreateLabel($Infection & " | " & $Location & " | " & $Difficulty, 10, 5, 400, 20) GUISetState(@SW_SHOW, $gui_game) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc