kalya Posted December 30, 2009 Share Posted December 30, 2009 what is wrong ? #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $q1=Random(0,10,1) $q2=Random(0,10,1) $Form1 = GUICreate("mate", 200, 151, 247, 132) $Label1 = GUICtrlCreateLabel($q1, 24, 40, 20, 17) $Label2 = GUICtrlCreateLabel($q2, 64, 40, 20, 17) $Input1 = GUICtrlCreateInput(" ", 102, 36,20, 17,0x2000) $Label3 = GUICtrlCreateLabel("+", 44, 40, 20, 17) $Label4 = GUICtrlCreateLabel("=", 84, 40, 20, 17) $Button1 = GUICtrlCreateButton("OK", 100, 112, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() $rez=$q1+$q2 Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $Button1 if $Input1 = $rez Then MsgBox(0,"","Yes") Else MsgBox(0,"","No") EndIf Exit EndSwitch WEnd Link to comment Share on other sites More sharing options...
99ojo Posted December 30, 2009 Share Posted December 30, 2009 Hi, if GuiCtrlRead ($Input1) = $rez should work. ;-)) Stefan Link to comment Share on other sites More sharing options...
kalya Posted December 30, 2009 Author Share Posted December 30, 2009 Hi,if GuiCtrlRead ($Input1) = $rez should work.;-))Stefanthanks Link to comment Share on other sites More sharing options...
kalya Posted December 30, 2009 Author Share Posted December 30, 2009 how can I loop this sequence ? $q1=Random(0,10,1) $q2=Random(0,10,1) $Form1 = GUICreate("mate", 200, 151, 247, 132) $Label1 = GUICtrlCreateLabel($q1, 24, 40, 20, 17) $Label2 = GUICtrlCreateLabel($q2, 64, 40, 20, 17) $Input1 = GUICtrlCreateInput(" ", 102, 36,20, 17,0x2000) $Label3 = GUICtrlCreateLabel("+", 44, 40, 20, 17) $Label4 = GUICtrlCreateLabel("=", 84, 40, 20, 17) until GuiCtrlRead ($Input1) <> $q1+$q2 Link to comment Share on other sites More sharing options...
somdcomputerguy Posted December 30, 2009 Share Posted December 30, 2009 Keyword Do...Until - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. 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