Sign in to follow this  
Followers 0
Guest Halobox

A simple addition

3 posts in this topic

Hello i wan to make an addition between 2 input like this :

$M = GUICtrlCreateInput("", 150, 40, 100, 20)

$MM = GUICtrlCreateInput("", 300, 40, 100, 20)

[...]

$MIN = $M / $MM

[...]

$res = GUICtrlCreateLabel("", 150, 150, 100, 20, 0x1000)

[...]

Case $msg = $button

;$results = Random(1,4)

;$MIN = " " & $MIN

GUICtrlSetData($res, $M)

But when I click on my button, i don't have the result, (it give always the same number)

Can you help me ?

Share this post


Link to post
Share on other sites

Addition symbol + for numbers

$MIN = $M + $MM

:)

Share this post


Link to post
Share on other sites

Hello i wan to make an addition between 2 input like this :

But when I click on my button, i don't have the result, (it give always the same number)

Can you help me ?

<{POST_SNAPBACK}>

To retrieve the specified values you need to do a GUICtrlRead() because you are now using the control HANDLES which always have the same values!!

Something like:

$M = GUICtrlCreateInput("", 150, 40, 100, 20)
$MM = GUICtrlCreateInput("", 300, 40, 100, 20)

[...]

$MIN = GUICTRLRead($M) / GUICTRLRead($MM)

[...]

$res = GUICtrlCreateLabel("", 150, 150, 100, 20, 0x1000)

[...]

Case $msg = $button
            ;$results = Random(1,4)
            ;$MIN = "  " & $MIN
             GUICtrlSetData($res, $MIN)

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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