papillon121 6 Posted July 17, 2017 Report Share Posted July 17, 2017 hello Guys and Girls, I have a short question about the "Loop while" function. loop while($contains(%firemailemaillist,"Name1")) { clear list(%firemailemaillist) add list to list(%firemailemaillist,$plugin function("TableCommands.dll", "$list from table", &firemail, "Row", $rand(20,60)),"Don\'t Delete","Global")} My intension was, that the loop while function did search all the time till they found "Name1" on firemaillist. But the loop while function doesent do that. Anyone knows why? would be great if someone got an idea. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted July 17, 2017 Report Share Posted July 17, 2017 Loop while means that while the condition is true run the code inside of me. So if that list contains Name1 then it runs the code inside and if you add the table and then it contains Name1 again then it runs again until it can't find Name1 in that list. Here is a super basic example to help you understand how it works: set(#num,0,"Global") loop while($comparison(#num,"<",5)) { increment(#num) } This says to increment #num while it's less than 5 and so the first time the condition is checked #num is 0 and therefore less than 5 so it increments #num. Then it checks again and now num is 1 and so it goes again until eventually num is 5 and since it is not less than 5 the loop while stops because the condition is no longer true. Quote Link to post Share on other sites
papillon121 6 Posted July 17, 2017 Author Report Share Posted July 17, 2017 Ah ok thank you very much, now i understand this function :-) hmmm but do. you have any idea how to solve my problem? Quote Link to post Share on other sites
HelloInsomnia 1103 Posted July 18, 2017 Report Share Posted July 18, 2017 Give this a try: set(#nameFound,"false","Global") loop while($comparison(#nameFound,"= Equals","false")) { clear list(%firemailemaillist) add list to list(%firemailemaillist,$plugin function("TableCommands.dll", "$list from table", &firemail, "Row", $rand(20,60)),"Don\'t Delete","Global") if($contains(%firemailemaillist,"Name1")) { then { set(#nameFound,"true","Global") } else { } } } Quote Link to post Share on other sites
papillon121 6 Posted July 20, 2017 Author Report Share Posted July 20, 2017 Give this a try: set(#nameFound,"false","Global") loop while($comparison(#nameFound,"= Equals","false")) { clear list(%firemailemaillist) add list to list(%firemailemaillist,$plugin function("TableCommands.dll", "$list from table", &firemail, "Row", $rand(20,60)),"Don\'t Delete","Global") if($contains(%firemailemaillist,"Name1")) { then { set(#nameFound,"true","Global") } else { } } }Thank you very much! That Code works GREAT!!!!! you the best :-) 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.