Location of table describing multiple equal-sign operators

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
WeThotUWasAToad
Posts: 312
Joined: 19 Nov 2013, 08:44

Location of table describing multiple equal-sign operators

18 Nov 2017, 18:58

Hello,
For a description of what the other operators do, see their related entries in this table.
The above statement regarding a bunch of equal-sign operators (:= += -= *= /= //= .= |= &= ^= >>= <<=) is from the AHK docs (https://autohotkey.com/docs/Variables.htm#Operators) in the section located here:

AHK docs > Variables & Expressions > Operators > Expression Operators (in descending precedence order) > Assign

Should the table referenced in the quote have a hyperlink? If not, where is the table with descriptions located?

Also, what is the function of the operator -= (which is the topic I was looking up in the first place)?

Thanks
A ------------------------------ [A LOT OF SPACE] ------------------------------ LOT

"ALOT" is not a word. It never has been a word and it never will be a word.
"A LOT" is 2 words. Remember it as though there's [A LOT OF SPACE] between them.
User avatar
Capn Odin
Posts: 1352
Joined: 23 Feb 2016, 19:45
Location: Denmark
Contact:

Re: Location of table describing multiple equal-sign operators

18 Nov 2017, 19:06

-= subtract something from a variable.

Code: Select all

var := 10
var -= 5
MsgBox, % var
Is the table not the one on the page in the docs ?
Please excuse my spelling I am dyslexic.
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Location of table describing multiple equal-sign operators

18 Nov 2017, 19:10

Can't help you with all that, but I can help you with "-="

Total <------------------------ Variable

Total:= 20 <-----------------------Total now has a value

Lets add to total

Total := Total + 10 <--------------- Total now has a value of 30 but look how much we had to type

Lets do the same thing short hand

Total:= 20
Total+=10 <-------------Just like before we added 10 to the value of total

Now we subtract

Long way:
Total:= 20
Total:=Total-10 <----------------------- Total now has a value of 10

Short way:
Total:=20
Total-=10 <----------------------- Total now has a value of 10

if we only need to add or subtract 1 we can do it like this
Total++ <---------------------------- added 1 to total

Total-- <------------------------------- subtracted 1 from total

Hope that was clear.
WeThotUWasAToad
Posts: 312
Joined: 19 Nov 2013, 08:44

Re: Location of table describing multiple equal-sign operators

18 Nov 2017, 20:39

Thanks for the responses.
Capn Odin wrote:Is the table not the one on the page in the docs ?
Yes, it actually is. I just checked it again and realized the prefixes (to each of those multiple operators) are listed elsewhere on the same page (i.e. without the accompanying equal sign).
A ------------------------------ [A LOT OF SPACE] ------------------------------ LOT

"ALOT" is not a word. It never has been a word and it never will be a word.
"A LOT" is 2 words. Remember it as though there's [A LOT OF SPACE] between them.
WeThotUWasAToad
Posts: 312
Joined: 19 Nov 2013, 08:44

Re: Location of table describing multiple equal-sign operators

18 Nov 2017, 20:43

Hellbent wrote:Can't help you with all that, but I can help you with "-="
...
Hope that was clear.
Yes, that is extremely clear — and quite simple (as are most things once you understand them).

Thanks
A ------------------------------ [A LOT OF SPACE] ------------------------------ LOT

"ALOT" is not a word. It never has been a word and it never will be a word.
"A LOT" is 2 words. Remember it as though there's [A LOT OF SPACE] between them.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: dipahk, Nerafius, RandomBoy and 190 guests