Jump to content

Incrementing variable


Recommended Posts

I know in c++ to increment a variable its like i++;

what is it in autoit. I know I could do $i = $i + 1 but whats the way in autoit

Either, as you stated:

$i = $i + 1

or else

$i += 1

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Link to comment
Share on other sites

  • Developers

I know in c++ to increment a variable its like i++;

what is it in autoit. I know I could do $i = $i + 1 but whats the way in autoit

That works in AutoIt3 too, but have you looked in the Helpfile for the answer?

Operator Description

=

Assignment. e.g. $var = 5 (assigns the number 5 to $var)

+=

Addition assignment. e.g. $var += 1 (adds 1 to $var)

-=

Subtraction assignment.

*=

Multiplication assignment.

/=

Division assignment.

&=

Concatenation assignment. e.g. $var = "one", and then $var &= 10 ($var now equals "one10")

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...