You are not logged in.

1

Tuesday, January 28th 2014, 12:18am

Loop into array

I have this simple code

Source code

1
2
3
4
5
6
set(item[0].value,2);
set(item[1].value,3);
set(item[2].value,4);
for(set(i,0), i LT item.count, inc(i),
  trace('i=',get(item[i].value)) 
);


But the code not work because output

i=null

What is wrong?
Thanks *confused*

This post has been edited 1 times, last edit by "abmcr" (Jan 28th 2014, 7:16am)


Alexey Tkachenko

Professional

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

2

Tuesday, January 28th 2014, 8:31am

Maybe this should be with get():

Source code

1
2
3
for(set(i,0), i LT item.count, inc(i),
 trace('i=',get(item[get(i)].value)) 
 );
Regards,

Alexey

jordi

Professional

Posts: 583

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

3

Tuesday, January 28th 2014, 12:39pm

I think the problem is because item.count is already null...

you should trace the value for item.count
everpano.com step beyond 360

4

Tuesday, January 28th 2014, 8:17pm

Maybe this should be with get():

Source code

1
2
3
for(set(i,0), i LT item.count, inc(i),
 trace('i=',get(item[get(i)].value)) 
 );


thank you
your code work

Similar threads