Problem using multichoice questions

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
rcovane
Posts: 26
Joined: August 18th, 2015, 6:45 am

Problem using multichoice questions

Post by rcovane »

Hi guys,

I'm having problems with multichoice questions on CSPro 6.2. I used this code:

Code: Select all

PROC P32

//Verify if any option was selected
if length(strip(P32)) = 0 then //Verify if any option was selected
	errmsg("Deve selecionar pelo menos uma opção.");
	reenter;
endif;

//Verify if "other" was selected
if pos("J", P32) = 0 then
	// "other" not selected
	skip to P33;
elseif pos("N", P32) <> 0 then
	// "other" selected - get note
	string oldnote = getnote();
	putnote(strip(P32_10OUTRA)); // put not on other
	P32_10OUTRA = editnote();
	putnote(oldnote); //restore oldnote
endif;

//setting the values for the questions
if poschar("A", P32) <> 0 then
	if accept("Esta vantagem: 'Benefícios sociais (mais escolas, centros de saúde, bombas de água)' e grande ou pequena?","Grande","Pequena")=1 then P32_1 = 1
	else P32_1 = 2;
	endif
else
	P32_1 = 9;
endif;

if poschar("B", P32) <> 0 then
	if accept("Esta vantagem: 'Acesso ao emprego ' e grande ou pequena?","Grande","Pequena")=1 then
		P32_2 = 1
	else
		P32_2 = 2;
	endif
else
	P32_2 = 9;
endif;

if poschar("C", P32) <> 0 then
	if accept("Esta vantagem: 'Abertura e manutenção de estradas' e grande ou pequena?","Grande","Pequena")=1 then
		P32_3 = 1
	else
		P32_3 = 2;
	endif
else
	P32_3 = 9;
endif;

if poschar("D", P32) <> 0 then
	if accept("Esta vantagem: 'Vinda de compradores para os produtos produzidos nas machambas' e grande ou pequena?","Grande","Pequena")=1 then
		P32_4 = 1
	else
		P32_4 = 2;
	endif
else
	P32_4 = 9;
endif;

if poschar("E", P32) <> 0 then
	if accept("Esta vantagem: 'Vinda de compradores de estacas, troncos de madeira, lenha, carvão' e grande ou pequena?","Grande","Pequena")=1 then
		P32_5 = 1
	else
		P32_5 = 2;
	endif
else
	P32_5 = 9;
endif;

if poschar("F", P32) <> 0 then
	if accept("Esta vantagem: 'Vinda de compradores de carne de caça' e grande ou pequena?","Grande","Pequena")=1 then
		P32_6 = 1
	else
		P32_6 = 2;
	endif
else
	P32_6 = 9;
endif;

if poschar("G", P32) <> 0 then
	if accept("Esta vantagem: 'Facilidade de transportar produtos para venda noutras zonas (sede do distrito; outro distrito; estrada nacional)' e grande ou pequena?","Grande","Pequena")=1 then
		P32_7 = 1
	else
		P32_7 = 2;
	endif
else
	P32_7 = 9;
endif;

if poschar("H", P32) <> 0 then
	if accept("Esta vantagem: 'Chapas a circular nas estradas que vêm dar à zona e que saem da zona' e grande ou pequena?","Grande","Pequena")=1 then
		P32_8 = 1
	else
		P32_8 = 2;
	endif
else
	P32_8 = 9;
endif;

if poschar("I", P32) <> 0 then
	if accept("Esta vantagem: 'Pessoas que vêm abrir negócio na zona' e grande ou pequena?","Grande","Pequena")=1 then
		P32_9 = 1
	else
		P32_9 = 2;
	endif
else
	P32_9 = 9;
endif;

if poschar("J", P32) <> 0 then
	if accept("Esta vantagem: 'Outra vantagem' e grande ou pequena?","Grande","Pequena")=1 then
		P32_10 = 1
	else
		P32_10 = 2;
	endif
else
	P32_10 = 9;
endif;


{============================================================================================================================}
It worked for some HH inquired but didn't work on others. It wrote the ansewrs for 6 of the 150 HH surveyed. I used android tablets for survey.

Please check the problem.

If needed I can send the application. My e-mail is roque.covane@gmail.com
Post Reply