simple math Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Nick Riviera
Posts: 36
Joined: 25 Aug 2021, 02:47

simple math

Post by Nick Riviera » 30 Jun 2022, 09:40

hello
beginner here...

why "b" var does not sum with "a" variable ?
in this case ,the result should be 255 instead 250
the function must remain as it is now
Thanks

Code: Select all

#SingleInstance, Force

Global a, b, x

	a := 5  
	b := 100 + a
	x := 150

sum(x) {

R1 := x  +  b
return R1
}
Gui, +AlwaysOnTop

Gui, Add, Text,w90 h30 , a
Gui, Add, Edit,w110 h30 va, 5

Gui, Add, Text, w90 h30 , b
Gui, Add, Edit, w110 h30 vb, 100

Gui, Add, Edit, w110 h50  vrez
Gui, Add, Button,w130 h20 cal, cal

Gui, Show
return

ButtonCal:

Gui, Submit, NoHide
rez:= %  sum(x)
GuiControl,, rez, %rez%
Return

GuiClose:
ExitApp

User avatar
mikeyww
Posts: 26897
Joined: 09 Sep 2014, 18:38

Re: simple math  Topic is solved

Post by mikeyww » 30 Jun 2022, 09:52

When you submit the GUI, the new values are used.

Nick Riviera
Posts: 36
Joined: 25 Aug 2021, 02:47

Re: simple math

Post by Nick Riviera » 30 Jun 2022, 13:20

now I understand
thank you
mikeyww wrote:
30 Jun 2022, 09:52
When you submit the GUI, the new values are used.

Post Reply

Return to “Ask for Help (v1)”