You are not logged in.

publicitarios360

Intermediate

  • "publicitarios360" started this thread

Posts: 330

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

1

Saturday, September 24th 2016, 9:25am

How to get the elements number in Array?

How many elements in Array?

Example:

<myarray
name="friends"
friend1="pedro"
friend2="jose"
friend3="alfredo"
/>

1. How to get the "elements count"?

In the help document, count is for "Get the current number of items in the array", but in this case is 1 (the item is "friends"). I need to get 3 (pedro,jose,alfredo). How?

2. How to put more items to "myarray"?

<myarray
name="friends"
friend1="pedro"
(...)
name="jobs"
job1...
job2...

3. Links with krpano examples of array?

Thanks a lot.

2

Saturday, September 24th 2016, 10:49am

<friends name="pedro" job="..." address="..." />
<friends name="jose" job="..." address="..." />
<friends name="alfredo" job="..." address="..." />

trace(friends.count); --> 3
trace(friends[2].name); --> alfredo
trace(friends[alfredo].job); --> ...

set(friends[sancho].job,"pansa");
trace(friends[3].name, friends[3].job); --> sancho pansa

publicitarios360

Intermediate

  • "publicitarios360" started this thread

Posts: 330

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

3

Saturday, September 24th 2016, 4:09pm

Thanks very much, your answer is very exact!!! *g*

Luca Vascon

Beginner

Posts: 15

Location: Venice, Italy

Occupation: VR under any aspect

  • Send private message

4

Wednesday, May 13th 2020, 12:58pm

thanx for the clarification, it's working for me too.
now it looks like whatever I read in the documentation is written in another language I DO NOT UNDERSTAND even if I do speak English.
It's also written with so many allusions and implications that is putting me to dismay. 8 years doing things with krpano, I'm still in copy and paste pieces + trial and error.
:-(

Similar threads