Jump to content

math related if statement


Recommended Posts

hi all,

Dumb question, but say I have a loop:

dim $i
Do
    sleep(1000)
    
    if $i = ; how do i do a function that enters this IF statement every 10 loops?
        ; do stuff every 10
    EndIf

    
Until $i = 100

 

- what commands in the if statement do I need to use to make it pass, and on every 10th loop, it enters the if statement. ?

 

Thanks

Link to comment
Share on other sites

  • Developers

@MrCheese,

You aren't incrementing $i so the posted script makes no sense!

As to you question: just make an if like this:

For $i = 1 to 100
    if mod($i,10) = 0 then
        ConsoleWrite($i & @CRLF)
    EndIf
Next

Jos

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

×
×
  • Create New...