You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, July 10th 2013, 3:56pm

simple 1D array question

I am trying to use array to store numerical values and I cannot get it to work:
set(hotspotarray[0], 0);

set(hotspotarray[1], 1);

trace('hotspot 0=', get(hotspotarray[0]));

trace('hotspot 1=', get(hotspotarray[1]));

Output:

hotspot 0 = 1 (WHY ???)

hotspot 1 = 1

Umalo

Professional

Posts: 1,047

Location: Osijek, Croatia, EU

  • Send private message

2

Thursday, July 11th 2013, 12:38am

I'm also still confused with arrays here. See link
This will work fine:

set(array[0].value,2);
set(array[1].value,3);
set(array[2].value,4);
set(array[3].value,5);

trace('hotspot 0=', get(array[0].value));
trace('hotspot 1=', get(array[1].value));
trace('hotspot 2=', get(array[2].value));
trace('hotspot 3=', get(array[3].value));

3

Thursday, July 11th 2013, 2:52pm

Thanks Umalo *thumbsup* . I have also found this very useful link:

set (and get) array elements

Similar threads