You are not logged in.

Search results

Search results 1-1 of 1.

Wednesday, August 14th 2019, 2:08pm

Author: sylvainlepetit

Array with scenes

It seems normal, you inc your variable c after use so when exit the loop it is one more than you want. With this code it should works better: createarray(areas); set(c,-1); for(set(i,0), i LT scene.count, inc(i), if(scene[get(i)].area == true, <!-- inc before use --> inc(c); set(areas[get(c)].value, get(scene[get(i)].content)); ); ); <!-- when use c it is at the last index or -1 if no scene into areas--> if(c GE 0, trace('last area is ', get(areas[get(c)].value)); , trace('No area'); );