13lack13lade Posted April 17, 2014 Posted April 17, 2014 (edited) i have a loop which does the below, now the $count is equal to a cell in excel that has 14 in it.. so i wanted the loop to do it 14 times however it is doing it 15 times.. is that because the first 1 does not count as the 14? *EDIT* had a play myself appear that, that is the case.. so i will just subtract all values by 1 to counter otherwise i could just simply change my code to " 0 to $count " if $lenclip <=7 Then for $b = 1 to $count sleep(100) send("{TAB 9}") sleep(100) send("{DELETE 9}") sleep(100) send($ledger) next else for $b = 1 to $count sleep(100) send("{TAB 8}") sleep(100) send("{DELETE 9}") sleep(100) send($ledger) Next EndIf Edited April 17, 2014 by 13lack13lade
GordonFreeman Posted April 17, 2014 Posted April 17, 2014 Yes, or for $b = 1 to $count -1 Frabjous Installation
kylomas Posted April 17, 2014 Posted April 17, 2014 13lack13lade, Verify what value is in $count. Run the following to see for...to loop increment behaviour. local $end = 14 for $a = 1 to $end ConsoleWrite($a & @LF) next kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
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