Nested loops

jbv at souslelogo.com jbv at souslelogo.com
Tue May 17 02:35:46 EDT 2022


Hi list,

What is the best and most efficient way to write the following
javascript loops in LC ?

for (let i = 0, j = myArray.length - 1; i < myArray.length; j = i++) {
}

This goes beyond simple nested loops.
So far, because of lack of time, I have pre-calculated the successive
values of i and j, and have put them into lists of words :
0 1 2 3 4 5
5 0 1 2 3 4
it remains fast enough for what I need to do, but there must be a more 
elegant approach...

Thanks.
jbv



More information about the use-livecode mailing list