Loop differences
Moderator: Martin
Loop differences
Wat is The difference between loop over list and loop over list (condensed)
Re: Loop differences
Basically the condensed version is as its name, more compact, smaller, more efficient.
But the code is much harder to read (more advanced), since it packs all the script into the condition expression.
Either one will work, but condensed version will less likely to hit Emergency stop, since there are only 2 elements in the loop; while the other has 4 elements.
Condensed version can run for 30 loops before hitting default Emergency stop; while other only for 15 loops.
Use the one you are comfortable with. if you have get used to the script block; you can use the condensed version.
But the code is much harder to read (more advanced), since it packs all the script into the condition expression.
Either one will work, but condensed version will less likely to hit Emergency stop, since there are only 2 elements in the loop; while the other has 4 elements.
Condensed version can run for 30 loops before hitting default Emergency stop; while other only for 15 loops.
Use the one you are comfortable with. if you have get used to the script block; you can use the condensed version.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Loop differences
Thanks for your fast reply! But when I want to use the loop it ask me for a variable. Why I have to select a variable?
Re: Loop differences
Of course, since the template loop over a list. You must select variable which is a list type. Example
If you use listvar as the list, it will show you toast message : a, b, then c.
Code: Select all
listvar = newList("a", "b", "c");
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.