Jump to content

A simple addition


Guest Halobox
 Share

Recommended Posts

Guest Halobox

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 ?

Link to comment
Share on other sites

  • Developers

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)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...