How do increment a variable???
I tried searching for increment... but didnt find anything.
Basically:
x = x + 1
but that didnt work....
Auto Increment
Started by
Jackson
, May 25 2010 06:12 PM
4 replies to this topic
#1
-
Posted 25 May 2010 - 06:12 PM
How do increment a variable???
I tried searching for increment... but didnt find anything.
Basically:
x = x + 1
but that didnt work....
It'd need to be x = %x% + 1, because with the = assignment operator, plain text is taken as a string, you have to enclose variables in %.
To use x + 1, you'd have to use := assignment operator, which takes plain text to be a variable and strings must be enclosed in quotation marks (").
With both, numbers are just typed normally.
#3
-
Posted 25 May 2010 - 06:36 PM
#4
-
Posted 25 May 2010 - 07:26 PM
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org
Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.
when I did x = %x% + 1, x then had: 1 + 1 because i had set x to be 1 in the start
but when i did x++ it worked.
Thanks
but when i did x++ it worked.
Thanks
#5
-
Posted 25 May 2010 - 07:28 PM