Sub-Items

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Sub-Items

Post by josh »

PERSON is a numeric variable. The occurrence label needs an alphanumeric or string. You can convert from the numeric to a string using maketext:
setocclabel(ROSTER000(curocc()), maketext("%d", PERSON));
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Re: Sub-Items

Post by MrTaco »

Thanks Josh....
Saint
Posts: 63
Joined: November 22nd, 2013, 4:59 am

Re: Sub-Items

Post by Saint »

Hi,
Not sure why you would want to use the variable 'person' in the setocclabel function. By default, the roster occurrences are labelled with the numeric values which is the same as what you have in the setocclabel. It gets interesting to label by name or at least something different than the default occurrence labels. Especially so, when you want to carry information from one roster to another. For example, if you first roster just listed the names of all household members and then you move to a second roster to get detailed information of the members, then you can load the names from the first roster as the occurrence labels in the new roster to guide enumerators.

In the attached application, I have slightly modified your application to label the occurrences with the name of the person. Hope it helps with your understanding.
Attachments
GetLabels funtion.zip
(3.27 KiB) Downloaded 283 times
Post Reply