Jump to content

Recommended Posts

Posted

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
  • Developers
Posted (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 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.
  :)

Posted

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!

  • Moderators
Posted

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!

Posted (edited)

markitus90,

Look at your "if" statements. You repeat a case three times...

kylomas

Edited 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...