markitus90 Posted December 23, 2011 Share Posted December 23, 2011 Hi sirs, I have a problem with a inputbox. The insered numbers are never used and always replaced by 3 and 4. I am grateful for your help. #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <Guicombobox.au3> #Region ### START Koda GUI section ### Form=c:\users\marco aurelio\desktop\koda\forms\xy coordenate.kxf $Form1_1 = GUICreate("Form1", 405, 326, 318, 175) $n1 = GUICtrlCreateInput("", 16, 48, 130, 21) $n2 = GUICtrlCreateInput("", 160, 48, 130, 21) $Combo = GUICtrlCreateCombo("Type", 320, 48, 73, 25) GUICtrlSetData(-1, "Addition|Substraction") $Begin = GUICtrlCreateButton("Start", 128, 184, 153, 57) Dim $Form1_1_AccelTable[1][2] = [["s", $Begin]] GUISetAccelerators($Form1_1_AccelTable) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $refresh = GUIGetMsg() Switch $refresh Case $GUI_EVENT_CLOSE Exit Case $n1 Case $n2 Case $Combo Case $Begin if _GUICtrlComboBox_GetCurSel($Combo) = 1 then MsgBox(0,'','') if _GUICtrlComboBox_GetCurSel($Combo) = 2 then GUICtrlRead($n1) if _GUICtrlComboBox_GetCurSel($Combo) = 2 then GUICtrlRead($n2) if _GUICtrlComboBox_GetCurSel($Combo) = 2 then MsgBox(0, '', $n1 + $n2) MsgBox(0, '', $n1 & ' ' & $n2) EndSwitch WEnd Link to comment Share on other sites More sharing options...
Developers Jos Posted December 23, 2011 Developers Share Posted December 23, 2011 You need to use GuiCtrlRead() to retrieve the Control value, you now retrieve the handle. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
markitus90 Posted December 23, 2011 Author Share Posted December 23, 2011 Hi Jos,i have used GUICtrlRead($n1) for the first number and GUICtrlRead($n2) for the second number.Is not correct? Why? Link to comment Share on other sites More sharing options...
Developers Jos Posted December 23, 2011 Developers Share Posted December 23, 2011 (edited) What do you do with the Value you retrieve, it currently goes nowhere.. Just store it in a Variable and use that in the msgbox() Edited December 23, 2011 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
markitus90 Posted December 23, 2011 Author Share Posted December 23, 2011 Ok, so Im trying to do a simple addition with 2 numbers insered manually, but i cant because scite takes always for the first number 3 and 4 the second. Thanks for help! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 23, 2011 Moderators Share Posted December 23, 2011 Hi Markitus90. But you're not using it in your Msgbox. Try: MsgBox(0, '', GUICtrlRead($n1) & ' ' & GUICtrlRead($n2)) And as Jos mentioned, currently you're pulling the data, but not really doing anything with it. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 23, 2011 Moderators Share Posted December 23, 2011 Try something like this for your return: MsgBox(0, '', GUICtrlRead($n1) + GUICtrlRead($n2)) "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
markitus90 Posted December 23, 2011 Author Share Posted December 23, 2011 Nice!! Problem solved! just a bit negligence. Thanks to all Link to comment Share on other sites More sharing options...
kylomas Posted December 23, 2011 Share Posted December 23, 2011 (edited) markitus90,Look at your "if" statements. You repeat a case three times...kylomas Edited December 23, 2011 by kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
markitus90 Posted December 23, 2011 Author Share Posted December 23, 2011 Thanks Kylomas, JLogan3o13 and Jos 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