Vaindam Posted December 13, 2016 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.
Moderators JLogan3o13 Posted December 13, 2016 Moderators 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!
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