Sign in to follow this  
Followers 0
kalya

beginner

5 posts in this topic

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

Share this post


Link to post
Share on other sites



Hi,

if GuiCtrlRead ($Input1) = $rez

should work.

;-))

Stefan

Share this post


Link to post
Share on other sites

Hi,

if GuiCtrlRead ($Input1) = $rez

should work.

;-))

Stefan

thanks

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0