Sign in to follow this  
Followers 0
xZZTx

Autoit Math

3 posts in this topic

Ok i just want to make a simple GUI Calculator but i don't know how to get autoit to read it as math

like if u do

$var1 = 5+5 then $var1 returns 10

but if u use a gui input and try and rerun it it just returns same thing u typed

$var2 = GUICtrlCreateInput ("",10 ,20 , 200, 20) and u type 5+5 into it it will return 5+5

is there anyway todo like $var2 = Math(5+5)


Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times..

Share this post


Link to post
Share on other sites



Ok i just want to make a simple GUI Calculator but i don't know how to get autoit to read it as math

like if u do

$var1 = 5+5 then $var1 returns 10

but if u use a gui input and try and rerun it it just returns same thing u typed

$var2 = GUICtrlCreateInput ("",10 ,20 , 200, 20) and u type 5+5 into it it will return 5+5

is there anyway todo like $var2 = Math(5+5)

You can use Execute() for that:

GUICreate("Extremely simple calculator", 320, 120)
    
    Dim $var  = GUICtrlCreateInput("", 10, 30, 300, 20) 
    Dim $btn = GUICtrlCreateButton("calc", 40, 75, 60, 20)
    Dim $msg
    
    GUISetState()
  
    While $msg <> -3
        $msg = GUIGetMsg()
        Select
            Case $msg = $btn
                MsgBox(0,'', Execute(GUICtrlRead($var)))
        EndSelect
    WEnd

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Sweet thx but now there is the long quest of trying to find a way to use variables..


Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times..

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