Show Function

Discussions about CSEntry
Post Reply
Stavros
Posts: 33
Joined: February 17th, 2014, 9:12 am

Show Function

Post by Stavros »

Hi all,

I am creating a CAPI mode application for a household survey. After completing the roster of the household, there are questions at various forms where the ID of the Respondent is asked. In in order the interviewer not to go backwards and look it up, I am using the show function where I include the ID code and Name. The command looks like:
onfocus
i=show(ROSTER000,IDCX,Q101,TITLE("ID","NAME"));

What I am wondering is if there is a function that gives the interviewer the option enter the ID by choosing,as with the show function there is just a pop up window and after the interviewer has to enter the ID code manually. I know it is not the best explanation but I hope you will get the meaning.
And one more thing about the show function. If the question is the first of the form (let's say 2.1), the table from the show function appears right after answering the last question of the previous form (let's say 1.10) and CAPI question that appears is still from 1.10 and not 2.1. Any ideas how to deal with these 2 issues?

Best,
Stavros
khurshid.arshad
Posts: 572
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Show Function

Post by khurshid.arshad »

Dear Stavros

I am doing the same thing but with seek function and using "@" symbol .

Example:
You have to forms one is Roster and other is Education and you want all the names one by one in education form.
Variable names in Roster [PID, Name, etc. ]
Variable Name in Education [EDU_PID, education status etc.]
create CountN, IndexID and GetName in Global.

Code: Select all

PROC EDU_PID

Preproc
	CountN=Count(PID);
	if CountN=curocc() then
		endgroup;
	else
		//seek id from Roster
		IndexID=curocc();
		SeekID = seek(PID, @IndexID);
		GetName=Name(SeekID);
	endif;
		//Put GetName in CAPI with %GetName%
Put GetName in CAPI window with %GetName%


I hope it works.
a.
Stavros
Posts: 33
Joined: February 17th, 2014, 9:12 am

Re: Show Function

Post by Stavros »

I found a solution using different code and commands.
PROC GLOBAL
Numeric currIdx;
numeric totalHHmembers;
array alpha(25) aRosterNames(20); // names of household members
array aRosterCodes(20); // codes of hh member value sets

PROC Q101 // Name
i=curocc();
aRosterCodes(i-1)=IDCX(i);
aRosterNames(i-1)=Q101(i);

PROC Q110 // This just a question whether to add more members or not at the roster

postproc

if Q110=0 then
if accept("ARE YOU SURE THERE ARE NOT ANY OTHER HOUSEHOLD MEMBERS THAT ARE NOT MENTIONED YET", "YES", "NO") = 1 then
totalHHmembers=curocc();
aRosterCodes(totalHHmembers) = notappl; // the remaining elements of the array are not applicable
endgroup;
else
reenter;
endif;
endif;

PROC Q200 // And this is the question for which I need the popup
preproc
setvalueset(Q200, aRosterCodes, aRosterNames);
set attributes($) assisted on;

I hope it helps
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Show Function

Post by josh »

@Stavros, in your solution please use string not alpha for the variable type. Alpha variables in logic are no longer recommended and have been replaced by strings where you do not have specify the length or use strip. Also do not use set attributes assisted. This is also old and has been replaced by setting the field capture type.

I have done something similar although instead of using accept I put the check for more people as a field on the form. This way if you move through the field a second time the dialog box doesn't pop up for each person.
CROSS PETER
Posts: 1
Joined: August 15th, 2016, 2:37 am

Re: Show Function

Post by CROSS PETER »

Hi all,

I am new to this software and i am creating a CAPI mode application for a household survey. After completing the roster of the household, there are questions at various forms where the ID of the Respondent is asked.In in order the interviewer not to go backwards and look it up,am using the show function.
i = show ( MODULE_B000, B03, B04, TITLE("MODULE_B000","B03", "B04")); MODULE_B000 contains all the household ID information , B03 is the item name for NAMES and B04 for SEX .
The pop up box is displayed just before the targeted questions.
Post Reply