Page 1 of 1

HH ROSTER

Posted: February 15th, 2019, 4:45 pm
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 ?

Re: HH ROSTER

Posted: February 16th, 2019, 7:52 am
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;

Re: HH ROSTER

Posted: February 16th, 2019, 2:00 pm
by Medah
Thank you. It works