Beiträge von sylvainlepetit

    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');
    );