epicjawa Posted November 22, 2013 Posted November 22, 2013 Hey guys, so I'm a Noob at this AutoIt program however I have some experience messing around with VBA and Matlab. So I was just wondering how to make this GUI run more than once. It calculates the first value fine the first time but if i put in another value it doesn't calculate it. Thanks if you take a look, peace! expandcollapse popup#region #AutoIt3Wrapper_useUpx=n #AutoIt3Wrapper_Usex64=n #EndRegion #cs #ce #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <Constants.au3> #include <Math.au3> #include <StaticConstants.au3> Global $nMsg, $convert1,$alchprice,$shopbuyprice GUICreate("High Alch Approximator by Epic Jawa 2013", 400, 200, -1, -1) $HighA = GUICtrlCreateGroup("High Alchemy Calculator", 8, 16,384, 100) GUICtrlCreateLabel("The price that the shop would pay:", 20, 40) $shopbuyprice = GUICtrlCreateInput("",200,37,40,21) GUICtrlCreateLabel("The high alchemy value is:", 20, 60) $convert1 = GUICtrlCreateButton("Convert", 20, 80) $clear = GUICtrlCreateButton("Clear Values", 100, 80) GUISetState(@SW_SHOW) $alchprice = GUICtrlCreateLabel("",150,60,40,20) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $convert1 $shopbuyprice = GUICtrlRead($shopbuyprice) GUICtrlSetData($alchprice, round($shopbuyprice*1.313433)) Case $clear GUICtrlSetData($alchprice,"") GUICtrlSetdata($shopbuyprice,0,"") EndSwitch WEnd GUIDelete()
Solution Valuater Posted November 22, 2013 Solution Posted November 22, 2013 (edited) Maybe... expandcollapse popup #region #AutoIt3Wrapper_useUpx=n #AutoIt3Wrapper_Usex64=n #endregion #cs #ce #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <Constants.au3> #include <Math.au3> #include <StaticConstants.au3> Global $nMsg, $convert1, $alchprice;, $shopbuyprice GUICreate("High Alch Approximator by Epic Jawa 2013", 400, 200, -1, -1) $HighA = GUICtrlCreateGroup("High Alchemy Calculator", 8, 16, 384, 100) GUICtrlCreateLabel("The price that the shop would pay:", 20, 40) $shopbuyprice = GUICtrlCreateInput("", 240, 37, 40, 21) GUICtrlCreateLabel("The high alchemy value is:", 20, 60) $convert1 = GUICtrlCreateButton("Convert", 20, 80) $clear = GUICtrlCreateButton("Clear Values", 100, 80) GUISetState(@SW_SHOW) $alchprice = GUICtrlCreateLabel("", 190, 60, 40, 20) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $convert1 $readshopbuyprice = GUICtrlRead($shopbuyprice) GUICtrlSetData($alchprice, Round($readshopbuyprice * 1.313433)) Case $clear GUICtrlSetData($alchprice, "") GUICtrlSetData($shopbuyprice, "", "") EndSwitch WEnd GUIDelete() Edited November 22, 2013 by Valuater
Valuater Posted November 22, 2013 Posted November 22, 2013 (edited) A control and a variable can not have the same name $shopbuyprice 8) PS. Nice try for a first post... 8) Edited November 22, 2013 by Valuater
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