Vaindam Posted December 13, 2016 Share Posted December 13, 2016 How can I loop from variable to 1 with step -1 Example: $HCount = ClipGet() For $i = $HCount to 1 Step -1 I have tried above but it is not working. Please help me. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 13, 2016 Moderators Share Posted December 13, 2016 (edited) @Vaindam please post your whole code, as it appears you have some logic issues. This, for example, works just fine. Local $aArray[10] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] ClipPut(UBound($aArray) - 1) Local $sVal = ClipGet() For $i = $sVal To 0 Step -1 ConsoleWrite($aArray[$i] & @CRLF) Next Edit: Also moved to correct forum Edited December 13, 2016 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Vaindam Posted December 13, 2016 Author Share Posted December 13, 2016 Thank you Link to comment Share on other sites More sharing options...
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