MrCheese Posted May 15, 2018 Posted May 15, 2018 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
Torvig1 Posted May 15, 2018 Posted May 15, 2018 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 Jos Posted May 15, 2018 Developers Posted May 15, 2018 @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.
MrCheese Posted May 15, 2018 Author Posted May 15, 2018 oh yeah forgot to add in the increment it was in my script.... as for your statement, thats great! thanks for that!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now