Form S_190FH
*===================================================================;
*;
* Component : S_190FH;
* Type : Form;
* Ancestor : PRIM_FORM (Primitive Form);
*;
* Description : Responses to other questions; ;
*;
* Full Description; This form takes all poll respondents who chose a particular;
* response to a particular question, and looks at their responses;
* to other questions.;
*;
* Disclaimer : The following material is supplied as sample material;
* only. No warranty concerning this material or its use;
* in any way whatsoever is expressed or implied.;
*;
* ===================================================================;
;
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM FORMSTYLE(Owned) HEIGHT(520) LAYOUTMANAGER(#SPLM_1) LEFT(377) TOP(216) VISUALSTYLE(#VS_NORM) WIDTH(644);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_1) CAPTION('Select another question that you would like to look at their responses for') DISPLAYPOSITION(1) HEIGHT(34) LEFT(39) PARENT(#GPBX_4) TABPOSITION(1) TABSTOP(False) TOP(27) WIDTH(214);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_1) CAPTION('How the selected respondents responded') DISPLAYPOSITION(1) HEIGHT(304) LAYOUTMANAGER(#ATLM_1) LEFT(0) PARENT(#PANL_3) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(319);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_2) CAPTION('The average response') DISPLAYPOSITION(1) HEIGHT(304) LAYOUTMANAGER(#ATLM_2) LEFT(0) PARENT(#PANL_4) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(313);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_2) CAPTION('For those who responded to the question: ') DISPLAYPOSITION(4) HEIGHT(38) LEFT(16) PARENT(#GPBX_3) TABPOSITION(4) TABSTOP(False) TOP(16) WIDTH(105);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_QUES) CAPTION('<text>') DISPLAYPOSITION(1) HEIGHT(38) LEFT(136) PARENT(#GPBX_3) TABPOSITION(1) TABSTOP(False) TOP(16) WIDTH(417);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_4) CAPTION('with the response:') DISPLAYPOSITION(2) HEIGHT(23) LEFT(16) PARENT(#GPBX_3) TABPOSITION(2) TABSTOP(False) TOP(64) WIDTH(97);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_RESPONSE) CAPTION('<text>') DISPLAYPOSITION(3) HEIGHT(23) LEFT(136) PARENT(#GPBX_3) TABPOSITION(3) TABSTOP(False) TOP(64) WIDTH(425);
DEFINE_COM CLASS(#PRIM_GRPH) NAME(#GRPH_AVG) DISPLAYPOSITION(1) HEIGHT(287) LEFT(4) PARENT(#GPBX_2) SCATTERSTYLE(SymbolAtPoints+Solid) SURFACESTYLE(ConnectLinesInBlack) TABPOSITION(1) TOP(13) WIDTH(305);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_1);
DEFINE_COM CLASS(#PRIM_GRPH) NAME(#GRPH_SEL) DISPLAYPOSITION(1) HEIGHT(287) LEFT(4) PARENT(#GPBX_1) SCATTERSTYLE(SymbolAtPoints+Solid) SURFACESTYLE(ConnectLinesInBlack) TABPOSITION(1) TOP(13) WIDTH(311);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_1) ATTACHMENT(Center) MANAGE(#GRPH_SEL) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_2);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_2) ATTACHMENT(Center) MANAGE(#GRPH_AVG) PARENT(#ATLM_2);
DEFINE_COM CLASS(#PRIM_GRCL) NAME(#GRCL_1) COLUMNSYMBOL(Cross) DISPLAYPOSITION(1) PARENT(#GRPH_SEL) SOURCE(#S_190RFRQ);
DEFINE_COM CLASS(#PRIM_GRCL) NAME(#GRCL_2) COLUMNSYMBOL(Cross) DISPLAYPOSITION(1) PARENT(#GRPH_AVG) SOURCE(#S_190RFRQ);
DEFINE_COM CLASS(#PRIM_GRCL) NAME(#GRCL_3) COLUMNROLE(Label) DISPLAYPOSITION(2) PARENT(#GRPH_SEL) SOURCE(#S_190PSA);
DEFINE_COM CLASS(#PRIM_GRCL) NAME(#GRCL_4) COLUMNROLE(Label) DISPLAYPOSITION(2) PARENT(#GRPH_AVG) SOURCE(#S_190PSA);
DEFINE_COM CLASS(#S_190RQN) NAME(#S_190RQN) DISPLAYPOSITION(2) LEFT(263) PARENT(#GPBX_4) TABPOSITION(2) TABSTOP(False) TOP(31);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_3) DISPLAYPOSITION(1) HEIGHT(97) LEFT(0) PARENT(#PANL_1) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(581);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_4) DISPLAYPOSITION(2) HEIGHT(81) LAYOUTMANAGER(#FWLM_1) LEFT(0) PARENT(#PANL_1) TABPOSITION(2) TABSTOP(False) TOP(97) WIDTH(581);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_1) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_1) MANAGE(#LABL_1) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_2) MANAGE(#S_190RQN) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_SPLM) NAME(#SPLM_1);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_1) DISPLAYPOSITION(1) HEIGHT(185) LEFT(0) PARENT(#COM_OWNER) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(636);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_2) DISPLAYPOSITION(2) HEIGHT(304) LAYOUTMANAGER(#SPLM_2) LEFT(0) PARENT(#COM_OWNER) TABPOSITION(2) TABSTOP(False) TOP(189) WIDTH(636);
DEFINE_COM CLASS(#PRIM_SPLI) NAME(#SPLI_1) MANAGE(#PANL_1) PARENT(#SPLM_1);
DEFINE_COM CLASS(#PRIM_SPLI) NAME(#SPLI_2) MANAGE(#PANL_2) PARENT(#SPLM_1) WEIGHT(1);
DEFINE_COM CLASS(#PRIM_SPLM) NAME(#SPLM_2) ORIENTATION(Vertical);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_3) DISPLAYPOSITION(1) HEIGHT(304) LAYOUTMANAGER(#ATLM_3) LEFT(0) PARENT(#PANL_2) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(319);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_4) DISPLAYPOSITION(2) HEIGHT(304) LAYOUTMANAGER(#ATLM_4) LEFT(323) PARENT(#PANL_2) TABPOSITION(2) TABSTOP(False) TOP(0) WIDTH(313);
DEFINE_COM CLASS(#PRIM_SPLI) NAME(#SPLI_3) MANAGE(#PANL_3) PARENT(#SPLM_2) WEIGHT(1);
DEFINE_COM CLASS(#PRIM_SPLI) NAME(#SPLI_4) MANAGE(#PANL_4) PARENT(#SPLM_2) WEIGHT(1);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_3);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_3) ATTACHMENT(Center) MANAGE(#GPBX_1) PARENT(#ATLM_3);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_4);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_4) ATTACHMENT(Center) MANAGE(#GPBX_2) PARENT(#ATLM_4);
;
define_pty CurrPoll get(*auto #S_190PID) ;
;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption(*component_desc);
ENDROUTINE;
*;
* Show how respondents who took this option, responded to other questions;
*;
MthRoutine uShowOtherQues;
Define_Map *Input #S_190PID #mS_190PID Desc('Poll Identifier') ;
Define_Map *Input #S_190PQN #mS_190PQN Desc('Question to be analysed') ;
Define_Map *Input #S_190PSN #mS_190PSN Desc('Response to be analysed') ;
;
;
CHANGE #S_190PID #mS_190PID.Value;
CHANGE #S_190PQNA #mS_190PQN.Value;
CHANGE #S_190PSNA #mS_190PSN.value;
;
FETCH #S_190PQL SETPQU with_key(#S_190PID #S_190PQNA);
set #LABL_QUES caption(#S_190PQL);
;
FETCH #S_190PSL SETPQS with_key(#S_190PID #S_190PQNA #S_190PSNA);
set #LABL_RESPONSE caption(#S_190PSL);
;
;
* build the list of other questions for this poll and first question (the first question should not be in the list);
invoke #S_190RQN.uSetPollQues mS_190PID(#S_190PID) mS_190PQN(0) mS_190NOT(#S_190PQNA);
;
;
* Build the list of respondents who answered the first question as specified;
;
DEFINE #S_190RIDW reffld(#S_190RID);
DEF_LIST NAME(#S_LSTRPNT) FIELDS(#S_190RIDW) TYPE(*WORKING) ENTRYS(5000);
CLR_LIST #S_LSTRPNT;
;
SELECT (#S_190RID) SETPRAL1 with_key(#S_190PID #S_190PQNA #S_190PSNA);
CHANGE #S_190RIDW #S_190RID;
ADD_ENTRY #S_LSTRPNT;
endselect;
;
invoke #Com_Owner.ShowForm;
;
return;
endroutine;
*;
* When a second question has been chosen, display the responses of the selected;
* group of respondents, and also the average responses. ;
EVTROUTINE HANDLING(#S_190RQN.QuestionSelected);
CHANGE #S_190PQNB #S_190RQN.CurrQuestion;
;
DEFINE #S_190TOT *DEC 5 0 DESC('Count of responses by anyone');
DEFINE #S_190RCT *DEC 5 0 DESC('Count of resp by selected respondents');
;
if '#S_190PQNB *EQ 0';
* Second question has not been selected ;
CLR_LIST #GRPH_SEL;
CLR_LIST #GRPH_AVG;
ELSE;
;
* Build the list of possible responses for the second question ;
DEF_LIST #S_LSTRESP (#S_190PSNB #S_190PSA #S_190TOT #S_190RCT) TYPE(*WORKING);
;
CHANGE (#S_190TOT #S_190RCT) *NULL;
CLR_LIST #S_LSTRESP;
SELECT (#S_190PSN #S_190PSA) SETPQS with_key(#S_190PID #S_190PQNB);
CHANGE #S_190PSNB #S_190PSN;
ADD_ENTRY #S_LSTRESP;
endselect;
;
;
* Determine the response counts for each possible response ;
SELECTLIST #S_LSTRESP;
CHANGE (#S_190TOT #S_190RCT) *NULL;
SELECT #S_190RID SETPRAL1 with_key(#S_190PID #S_190PQNB #S_190PSNB);
* Increment the number of respondents of any kind taking this response;
CHANGE #S_190TOT '#S_190TOT + 1';
;
* Check whether this respondent is in the list of selected respondents;
LOC_ENTRY IN_LIST(#S_LSTRPNT) WHERE('#S_190RID *EQ #S_190RIDW') RET_ENTRY(*NO);
IF_STATUS *OKAY;
* Increment the number of responses made by the selected respondents;
CHANGE #S_190RCT '#S_190RCT + 1';
ENDIF;
ENDSELECT;
UPD_ENTRY #S_LSTRESP;
ENDSELECT;
;
* Load the responses into the graphs;
;
;
CLR_LIST #GRPH_SEL;
CLR_LIST #GRPH_AVG;
SELECTLIST #S_LSTRESP ;
CHANGE #S_190RFRQ #S_190RCT;
ADD_ENTRY #GRPH_SEL;
;
CHANGE #S_190RFRQ #S_190TOT;
ADD_ENTRY #GRPH_AVG;
;
ENDSELECT;
ENDIF;
ENDROUTINE;
END_COM;
*===================================================================;
*;
* Component : S_190FH;
* Type : Form;
* Ancestor : PRIM_FORM (Primitive Form);
*;
* Description : Responses to other questions; ;
*;
* Full Description; This form takes all poll respondents who chose a particular;
* response to a particular question, and looks at their responses;
* to other questions.;
*;
* Disclaimer : The following material is supplied as sample material;
* only. No warranty concerning this material or its use;
* in any way whatsoever is expressed or implied.;
*;
* ===================================================================;
;
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM FORMSTYLE(Owned) HEIGHT(520) LAYOUTMANAGER(#SPLM_1) LEFT(377) TOP(216) VISUALSTYLE(#VS_NORM) WIDTH(644);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_1) CAPTION('Select another question that you would like to look at their responses for') DISPLAYPOSITION(1) HEIGHT(34) LEFT(39) PARENT(#GPBX_4) TABPOSITION(1) TABSTOP(False) TOP(27) WIDTH(214);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_1) CAPTION('How the selected respondents responded') DISPLAYPOSITION(1) HEIGHT(304) LAYOUTMANAGER(#ATLM_1) LEFT(0) PARENT(#PANL_3) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(319);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_2) CAPTION('The average response') DISPLAYPOSITION(1) HEIGHT(304) LAYOUTMANAGER(#ATLM_2) LEFT(0) PARENT(#PANL_4) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(313);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_2) CAPTION('For those who responded to the question: ') DISPLAYPOSITION(4) HEIGHT(38) LEFT(16) PARENT(#GPBX_3) TABPOSITION(4) TABSTOP(False) TOP(16) WIDTH(105);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_QUES) CAPTION('<text>') DISPLAYPOSITION(1) HEIGHT(38) LEFT(136) PARENT(#GPBX_3) TABPOSITION(1) TABSTOP(False) TOP(16) WIDTH(417);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_4) CAPTION('with the response:') DISPLAYPOSITION(2) HEIGHT(23) LEFT(16) PARENT(#GPBX_3) TABPOSITION(2) TABSTOP(False) TOP(64) WIDTH(97);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_RESPONSE) CAPTION('<text>') DISPLAYPOSITION(3) HEIGHT(23) LEFT(136) PARENT(#GPBX_3) TABPOSITION(3) TABSTOP(False) TOP(64) WIDTH(425);
DEFINE_COM CLASS(#PRIM_GRPH) NAME(#GRPH_AVG) DISPLAYPOSITION(1) HEIGHT(287) LEFT(4) PARENT(#GPBX_2) SCATTERSTYLE(SymbolAtPoints+Solid) SURFACESTYLE(ConnectLinesInBlack) TABPOSITION(1) TOP(13) WIDTH(305);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_1);
DEFINE_COM CLASS(#PRIM_GRPH) NAME(#GRPH_SEL) DISPLAYPOSITION(1) HEIGHT(287) LEFT(4) PARENT(#GPBX_1) SCATTERSTYLE(SymbolAtPoints+Solid) SURFACESTYLE(ConnectLinesInBlack) TABPOSITION(1) TOP(13) WIDTH(311);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_1) ATTACHMENT(Center) MANAGE(#GRPH_SEL) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_2);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_2) ATTACHMENT(Center) MANAGE(#GRPH_AVG) PARENT(#ATLM_2);
DEFINE_COM CLASS(#PRIM_GRCL) NAME(#GRCL_1) COLUMNSYMBOL(Cross) DISPLAYPOSITION(1) PARENT(#GRPH_SEL) SOURCE(#S_190RFRQ);
DEFINE_COM CLASS(#PRIM_GRCL) NAME(#GRCL_2) COLUMNSYMBOL(Cross) DISPLAYPOSITION(1) PARENT(#GRPH_AVG) SOURCE(#S_190RFRQ);
DEFINE_COM CLASS(#PRIM_GRCL) NAME(#GRCL_3) COLUMNROLE(Label) DISPLAYPOSITION(2) PARENT(#GRPH_SEL) SOURCE(#S_190PSA);
DEFINE_COM CLASS(#PRIM_GRCL) NAME(#GRCL_4) COLUMNROLE(Label) DISPLAYPOSITION(2) PARENT(#GRPH_AVG) SOURCE(#S_190PSA);
DEFINE_COM CLASS(#S_190RQN) NAME(#S_190RQN) DISPLAYPOSITION(2) LEFT(263) PARENT(#GPBX_4) TABPOSITION(2) TABSTOP(False) TOP(31);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_3) DISPLAYPOSITION(1) HEIGHT(97) LEFT(0) PARENT(#PANL_1) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(581);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_4) DISPLAYPOSITION(2) HEIGHT(81) LAYOUTMANAGER(#FWLM_1) LEFT(0) PARENT(#PANL_1) TABPOSITION(2) TABSTOP(False) TOP(97) WIDTH(581);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_1) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_1) MANAGE(#LABL_1) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_2) MANAGE(#S_190RQN) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_SPLM) NAME(#SPLM_1);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_1) DISPLAYPOSITION(1) HEIGHT(185) LEFT(0) PARENT(#COM_OWNER) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(636);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_2) DISPLAYPOSITION(2) HEIGHT(304) LAYOUTMANAGER(#SPLM_2) LEFT(0) PARENT(#COM_OWNER) TABPOSITION(2) TABSTOP(False) TOP(189) WIDTH(636);
DEFINE_COM CLASS(#PRIM_SPLI) NAME(#SPLI_1) MANAGE(#PANL_1) PARENT(#SPLM_1);
DEFINE_COM CLASS(#PRIM_SPLI) NAME(#SPLI_2) MANAGE(#PANL_2) PARENT(#SPLM_1) WEIGHT(1);
DEFINE_COM CLASS(#PRIM_SPLM) NAME(#SPLM_2) ORIENTATION(Vertical);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_3) DISPLAYPOSITION(1) HEIGHT(304) LAYOUTMANAGER(#ATLM_3) LEFT(0) PARENT(#PANL_2) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(319);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_4) DISPLAYPOSITION(2) HEIGHT(304) LAYOUTMANAGER(#ATLM_4) LEFT(323) PARENT(#PANL_2) TABPOSITION(2) TABSTOP(False) TOP(0) WIDTH(313);
DEFINE_COM CLASS(#PRIM_SPLI) NAME(#SPLI_3) MANAGE(#PANL_3) PARENT(#SPLM_2) WEIGHT(1);
DEFINE_COM CLASS(#PRIM_SPLI) NAME(#SPLI_4) MANAGE(#PANL_4) PARENT(#SPLM_2) WEIGHT(1);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_3);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_3) ATTACHMENT(Center) MANAGE(#GPBX_1) PARENT(#ATLM_3);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_4);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_4) ATTACHMENT(Center) MANAGE(#GPBX_2) PARENT(#ATLM_4);
;
define_pty CurrPoll get(*auto #S_190PID) ;
;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption(*component_desc);
ENDROUTINE;
*;
* Show how respondents who took this option, responded to other questions;
*;
MthRoutine uShowOtherQues;
Define_Map *Input #S_190PID #mS_190PID Desc('Poll Identifier') ;
Define_Map *Input #S_190PQN #mS_190PQN Desc('Question to be analysed') ;
Define_Map *Input #S_190PSN #mS_190PSN Desc('Response to be analysed') ;
;
;
CHANGE #S_190PID #mS_190PID.Value;
CHANGE #S_190PQNA #mS_190PQN.Value;
CHANGE #S_190PSNA #mS_190PSN.value;
;
FETCH #S_190PQL SETPQU with_key(#S_190PID #S_190PQNA);
set #LABL_QUES caption(#S_190PQL);
;
FETCH #S_190PSL SETPQS with_key(#S_190PID #S_190PQNA #S_190PSNA);
set #LABL_RESPONSE caption(#S_190PSL);
;
;
* build the list of other questions for this poll and first question (the first question should not be in the list);
invoke #S_190RQN.uSetPollQues mS_190PID(#S_190PID) mS_190PQN(0) mS_190NOT(#S_190PQNA);
;
;
* Build the list of respondents who answered the first question as specified;
;
DEFINE #S_190RIDW reffld(#S_190RID);
DEF_LIST NAME(#S_LSTRPNT) FIELDS(#S_190RIDW) TYPE(*WORKING) ENTRYS(5000);
CLR_LIST #S_LSTRPNT;
;
SELECT (#S_190RID) SETPRAL1 with_key(#S_190PID #S_190PQNA #S_190PSNA);
CHANGE #S_190RIDW #S_190RID;
ADD_ENTRY #S_LSTRPNT;
endselect;
;
invoke #Com_Owner.ShowForm;
;
return;
endroutine;
*;
* When a second question has been chosen, display the responses of the selected;
* group of respondents, and also the average responses. ;
EVTROUTINE HANDLING(#S_190RQN.QuestionSelected);
CHANGE #S_190PQNB #S_190RQN.CurrQuestion;
;
DEFINE #S_190TOT *DEC 5 0 DESC('Count of responses by anyone');
DEFINE #S_190RCT *DEC 5 0 DESC('Count of resp by selected respondents');
;
if '#S_190PQNB *EQ 0';
* Second question has not been selected ;
CLR_LIST #GRPH_SEL;
CLR_LIST #GRPH_AVG;
ELSE;
;
* Build the list of possible responses for the second question ;
DEF_LIST #S_LSTRESP (#S_190PSNB #S_190PSA #S_190TOT #S_190RCT) TYPE(*WORKING);
;
CHANGE (#S_190TOT #S_190RCT) *NULL;
CLR_LIST #S_LSTRESP;
SELECT (#S_190PSN #S_190PSA) SETPQS with_key(#S_190PID #S_190PQNB);
CHANGE #S_190PSNB #S_190PSN;
ADD_ENTRY #S_LSTRESP;
endselect;
;
;
* Determine the response counts for each possible response ;
SELECTLIST #S_LSTRESP;
CHANGE (#S_190TOT #S_190RCT) *NULL;
SELECT #S_190RID SETPRAL1 with_key(#S_190PID #S_190PQNB #S_190PSNB);
* Increment the number of respondents of any kind taking this response;
CHANGE #S_190TOT '#S_190TOT + 1';
;
* Check whether this respondent is in the list of selected respondents;
LOC_ENTRY IN_LIST(#S_LSTRPNT) WHERE('#S_190RID *EQ #S_190RIDW') RET_ENTRY(*NO);
IF_STATUS *OKAY;
* Increment the number of responses made by the selected respondents;
CHANGE #S_190RCT '#S_190RCT + 1';
ENDIF;
ENDSELECT;
UPD_ENTRY #S_LSTRESP;
ENDSELECT;
;
* Load the responses into the graphs;
;
;
CLR_LIST #GRPH_SEL;
CLR_LIST #GRPH_AVG;
SELECTLIST #S_LSTRESP ;
CHANGE #S_190RFRQ #S_190RCT;
ADD_ENTRY #GRPH_SEL;
;
CHANGE #S_190RFRQ #S_190TOT;
ADD_ENTRY #GRPH_AVG;
;
ENDSELECT;
ENDIF;
ENDROUTINE;
END_COM;