variable -1 Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
7lux

variable -1

18 Mar 2018, 04:06

Hi

i have a variable card1, i need a msgbox that shows the variable -1
something like:

Code: Select all

card1=5
card2= %card1%-1
{
MsgBox, %card2%
}
this has to be very simple but i cant figure it out,
hope someone can solve this for me
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: variable -1

18 Mar 2018, 04:57

card1 := 5
MsgBox % card2 := card1 - 1
Odlanir
Posts: 659
Joined: 20 Oct 2016, 08:20

Re: variable -1  Topic is solved

18 Mar 2018, 07:46

Or even

Code: Select all

card1 := 5
MsgBox % --card1
card1 := 5
MsgBox % card1 -=1
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
gregster
Posts: 8988
Joined: 30 Sep 2013, 06:48

Re: variable -1

18 Mar 2018, 13:48

Or force an expression

Code: Select all

card1=5
card2= % card1 -1
MsgBox, %card2%
But variable assignment is here done with legacy syntax ( = )... better use the other suggested ways (expression syntax := )

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: gongnl, Google [Bot], mamo691, mcd, mikeyww, MrDoge, ReyAHK and 237 guests