Jump to content

Recommended Posts

Posted

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

Posted

I reckon you could probaly make a repeat func in the loop that will repeat 10 times then do your if statement and then because its in the loop it will do it agian.

Does that make sense?

  • Developers
Posted

@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.
  :)

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
×
×
  • Create New...