streetcreeppress Posted July 26, 2019 Share Posted July 26, 2019 Hi, don't understand why this simple piece of code would not work... What I am trying to do here, is find the index from the first loop that is not present on the second loop. I am able to print it inside a loop but I cannot call it again after. Here is how I set this up; Global $newVar Global $switch For $i = 0 To 6 Step 1 $switch = 0 For $x = 0 To 5 Step 1 If $x == $i Then $switch = 1 EndIf Next If $switch == 0 Then $newVar = $x ; this will print. ConsoleWrite($newVar & @CRLF) Exit EndIf Next ; this will not print!?!?! ConsoleWrite($newVar & @CRLF) If I run this, I don't get the console print outside/after the for loop... Any ideas why this would not work? Link to comment Share on other sites More sharing options...
Subz Posted July 26, 2019 Share Posted July 26, 2019 Use Exitloop not Exit Earthshine 1 Link to comment Share on other sites More sharing options...
streetcreeppress Posted July 26, 2019 Author Share Posted July 26, 2019 @Subz Oh my goodness thanks! woohoo this works great now 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