HH ROSTER

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
Post Reply
Medah
Posts: 2
Joined: February 15th, 2019, 4:36 pm

HH ROSTER

Post by Medah »

Hello,
I need To have 2 sections:
Section 1 : HH membres
Item 1 : ID
Item 2 : Name of individual

Section 2 : HH roster
Item 1 : HH_ID
Item 2 : Name
....
....
Etc.

So I need To enumerate All the Names of HH members in Section 1, after that I want that Cspro count the number of occurrences in Section 1 and then automaticly generate me in Section 2 The total occurence of Section 1.
Please tell me how To do that in Cspro ?
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: HH ROSTER

Post by josh »

You can use subscripts to access the variables in a roster so to copy the name from one roster to another, assuming the name of the variable in roster 1 is NAME and in roster the variable is NAME_OTHER_ROSTER, you would do:
NAME_OTHER_ROSTER(1) = NAME(1);
NAME_OTHER_ROSTER(2) = NAME(2);
NAME_OTHER_ROSTER(3) = NAME(3);
etc...
Since the size of the roster may vary you can use a loop to do this once for each row of the roster by looping from 1 to the size of the roster (assuming the name of the first roster is FIRST_ROSTER):
do numeric i = 1 while i <= totocc(FIRST_ROSTER)
    NAME_OTHER_ROSTER(i) = NAME(i);
enddo;
Medah
Posts: 2
Joined: February 15th, 2019, 4:36 pm

Re: HH ROSTER

Post by Medah »

Thank you. It works
Post Reply