Form S_190FA
*===================================================================;
*;
* Component : S_190FA;
* Type : Form;
* Ancestor : PRIM_FORM (Primitive Form);
*;
* Description : Poll Questions; ;
*;
* Full Description; This form allows maintenance of questions and responses to questions.;
* Polls can be run as the user would run them; ;
* From this form there are links to poll creation and maintenance and ;
* also to analysis of responses to 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 FRAMESTYLE(Single) HEIGHT(727) LAYOUTMANAGER(#FWLM_3) LEFT(148) TOP(3) VISUALSTYLE(#VS_NORM) WIDTH(614);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_1) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_QUESDET) CAPTION('Question details') DISPLAYPOSITION(3) HEIGHT(225) LEFT(-1) PARENT(#COM_OWNER) TABPOSITION(1) TABSTOP(False) TOP(262) WIDTH(609);
DEFINE_COM CLASS(#PRIM_MEMO) NAME(#MEMO_1) ADDENTRYMODE(MultiplePerLine) CURRENTLINE(1) DISPLAYPOSITION(2) HEIGHT(93) LEFT(192) MAXIMUMLINELENGTH(256) MAXIMUMLINES(1) PARENT(#GPBX_QUESDET) TABPOSITION(3) TOP(80) WIDTH(321) WORDWRAP(True);
DEFINE_COM CLASS(#S_190PQA.Visual) NAME(#S_190PQA) DISPLAYPOSITION(3) HEIGHT(19) LEFT(192) PARENT(#GPBX_QUESDET) TABPOSITION(2) TOP(48) WIDTH(321);
DEFINE_COM CLASS(#PRIM_MECL) NAME(#MECL_1) COLUMNROLE(Data) DISPLAYPOSITION(1) PARENT(#MEMO_1) SOURCE(#S_190PQL) WIDTH(20);
DEFINE_COM CLASS(#VL_SAM003) NAME(#VL_SAM003);
DEFINE_COM CLASS(#S_190RQT) NAME(#S_190RQT) LEFT(16) PARENT(#GPBX_QUESDET) TABPOSITION(4) TABSTOP(False) TOP(16);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_RESP) CAPTION('Possible Responses') DISPLAYPOSITION(4) HEIGHT(156) LEFT(-1) PARENT(#COM_OWNER) TABPOSITION(2) TABSTOP(False) TOP(498) WIDTH(609);
DEFINE_COM CLASS(#PRIM_GRID) NAME(#GRID_1) DISPLAYPOSITION(1) HEIGHT(129) LEFT(16) PARENT(#GPBX_RESP) ROWHEIGHT(18) TABPOSITION(1) TOP(16) WIDTH(569);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_1) CAPTION('Number') CAPTIONTYPE(Caption) DISPLAYPOSITION(1) PARENT(#GRID_1) SOURCE(#S_190PSN) WIDTH(10);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_2) CAPTION('Abbrev. Selection ') CAPTIONTYPE(Caption) DISPLAYPOSITION(2) PARENT(#GRID_1) READONLY(False) SOURCE(#S_190PSA) WIDTH(20);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_3) DISPLAYPOSITION(3) PARENT(#GRID_1) READONLY(False) SOURCE(#S_190PSL) WIDTH(20) WIDTHTYPE(Remainder);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_2) FLOWOPERATION(Center) FLOWOPERATIONHOR(Spread);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_SAVE) DISPLAYPOSITION(4) ENABLED(False) HEIGHT(33) HINT('Save Question and responses') IMAGE(#VB_SAVE) LEFT(536) PARENT(#GPBX_QUESDET) TABPOSITION(5) TOP(24) WIDTH(40);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_CANC) DISPLAYPOSITION(5) ENABLED(False) HEIGHT(33) HINT('Cancel changes') IMAGE(#VB_UNDO) LEFT(536) PARENT(#GPBX_QUESDET) TABPOSITION(6) TOP(64) WIDTH(40);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_3) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread) SPACING(0) SPACINGITEMS(0);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_4) MANAGE(#GPBX_QUESDET) PARENT(#FWLM_3);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_5) MANAGE(#GPBX_RESP) PARENT(#FWLM_3);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_POLL) CAPTION('List of Polls') DISPLAYPOSITION(1) HEIGHT(111) LAYOUTMANAGER(#ATLM_1) LEFT(-1) PARENT(#COM_OWNER) TABPOSITION(3) TABSTOP(False) TOP(11) WIDTH(609);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_7) MANAGE(#GPBX_POLL) PARENT(#FWLM_3);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_QUESLST) CAPTION('List of Questions') DISPLAYPOSITION(2) HEIGHT(118) LAYOUTMANAGER(#ATLM_2) LEFT(-1) PARENT(#COM_OWNER) TABPOSITION(4) TABSTOP(False) TOP(133) WIDTH(609);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_8) MANAGE(#GPBX_QUESLST) PARENT(#FWLM_3);
DEFINE_COM CLASS(#S_190RPL) NAME(#S_190RPL) HEIGHT(94) LEFT(4) PARENT(#GPBX_POLL) POPUPMENU(#PMNU_POLL) TABSTOP(False) TOP(13) WIDTH(532);
DEFINE_COM CLASS(#S_190RQL) NAME(#S_190RQL) HEIGHT(101) LEFT(4) PARENT(#GPBX_QUESLST) POPUPMENU(#PMNU_QUES) TABSTOP(False) TOP(13) WIDTH(532);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_1);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_1) ATTACHMENT(Center) MANAGE(#S_190RPL) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_2);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_2) ATTACHMENT(Center) MANAGE(#S_190RQL) PARENT(#ATLM_2);
DEFINE_COM CLASS(#S_190PQSQ.Visual) NAME(#S_190PQSQ) DISPLAYPOSITION(6) HEIGHT(19) LEFT(192) PARENT(#GPBX_QUESDET) TABPOSITION(1) TOP(24) WIDTH(209);
DEFINE_COM CLASS(#PRIM_PMNU) NAME(#PMNU_POLL);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_NEWP) CAPTION('New Poll') DISPLAYPOSITION(1) PARENT(#PMNU_POLL);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_EDTP) CAPTION('Edit Poll') DISPLAYPOSITION(2) PARENT(#PMNU_POLL);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_DELP) CAPTION('Delete Poll') DISPLAYPOSITION(3) PARENT(#PMNU_POLL);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_CLSP) CAPTION('Close Poll') DISPLAYPOSITION(5) PARENT(#PMNU_POLL);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_RUNP) CAPTION('Run Poll') DISPLAYPOSITION(6) PARENT(#PMNU_POLL);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_OPNP) CAPTION('Open Poll') DISPLAYPOSITION(4) PARENT(#PMNU_POLL);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_1) DISPLAYPOSITION(2) HEIGHT(94) LAYOUTMANAGER(#FWLM_4) LEFT(536) PARENT(#GPBX_POLL) TABPOSITION(2) TABSTOP(False) TOP(13) WIDTH(69);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_5) ATTACHMENT(Right) MANAGE(#PANL_1) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_4) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_NEWP) DISPLAYPOSITION(1) HEIGHT(33) HINT('New Poll') IMAGE(#VB_NEW) LEFT(14) PARENT(#PANL_1) TABPOSITION(1) TOP(6) WIDTH(40);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_1) MANAGE(#PHBN_NEWP) PARENT(#FWLM_4);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_DELP) DISPLAYPOSITION(2) HEIGHT(33) HINT('Delete Poll') IMAGE(#VB_DELETE) LEFT(14) PARENT(#PANL_1) TABPOSITION(2) TOP(55) WIDTH(40);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_2) MANAGE(#PHBN_DELP) PARENT(#FWLM_4);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_2) DISPLAYPOSITION(2) HEIGHT(101) LAYOUTMANAGER(#FWLM_5) LEFT(536) PARENT(#GPBX_QUESLST) TABPOSITION(2) TABSTOP(False) TOP(13) WIDTH(69);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_6) ATTACHMENT(Right) MANAGE(#PANL_2) PARENT(#ATLM_2);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_5) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_NEWQ) DISPLAYPOSITION(1) HEIGHT(33) HINT('New Question') IMAGE(#VB_NEW) LEFT(14) PARENT(#PANL_2) TABPOSITION(1) TOP(8) WIDTH(40);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_3) MANAGE(#PHBN_NEWQ) PARENT(#FWLM_5);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_DELQ) DISPLAYPOSITION(2) HEIGHT(33) HINT('Delete Question') IMAGE(#VB_DELETE) LEFT(14) PARENT(#PANL_2) TABPOSITION(2) TOP(59) WIDTH(40);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_9) MANAGE(#PHBN_DELQ) PARENT(#FWLM_5);
DEFINE_COM CLASS(#S_190FB) NAME(#S_190FB);
DEFINE_COM CLASS(#S_190FF) NAME(#S_190FF);
DEFINE_COM CLASS(#PRIM_PMNU) NAME(#PMNU_QUES);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_QBRK) CAPTION('Breakdown of responses') DISPLAYPOSITION(1) PARENT(#PMNU_QUES);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_QREL) CAPTION('Relationship between responses for two questions') DISPLAYPOSITION(2) PARENT(#PMNU_QUES);
DEFINE_COM CLASS(#S_190FG) NAME(#S_190FG);
DEFINE_COM CLASS(#S_190FI) NAME(#S_190FI);
DEFINE_COM CLASS(#S_190FJ) NAME(#S_190FJ);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_10) MANAGE(#S_155RST) PARENT(#FWLM_3);
DEFINE_COM CLASS(#S_155FLG) NAME(#S_155FLG);
DEFINE_COM CLASS(#PRIM_STBR) NAME(#STBR_1) DISPLAYPOSITION(5) HEIGHT(24) LEFT(0) MESSAGEPOSITION(1) PARENT(#COM_OWNER) TABPOSITION(5) TABSTOP(False) TOP(676) WIDTH(606);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_6) MANAGE(#STBR_1) PARENT(#FWLM_3);
DEFINE_COM CLASS(#S_155RST) NAME(#S_155RST) HEIGHT(18) LEFT(367) PARENT(#STBR_1) TABSTOP(False) TOP(4) WIDTH(237);
;
define_evt QuestionDetailsChgd help('This event is signaled when the user has made changes to the details of a question, including changes to the possible responses ');
;
;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption(*component_desc);
;
* Disable all options until the user connects to the AS/400;
;
set (#PHBN_NEWP #MITM_NEWP #PHBN_DELP #MITM_DELP) Enabled(FALSE);
set (#GPBX_QUESDET #GPBX_RESP #PHBN_NEWQ #PHBN_DELQ ) Enabled(FALSE);
set (#MITM_OPNP #MITM_EDTP) enabled(FALSE);
set (#MITM_CLSP #MITM_RUNP ) enabled(FALSE);
;
invoke #VL_SAM003.uConnectModal;
if '*sserver_type *ne AS400';
invoke #COM_Owner.CloseForm;
else;
;
* Enable new poll option regardless of whether a poll gets selection ;
set (#PHBN_NEWP) Enabled(TRUE);
;
* Remove status bar fields that are not needed;
Set #S_155RST uShowDate(FALSE) uStatusText(' ') uStatusNumber(0);
;
* Set the status bar into a busy state ;
Set #S_155RST uBusy(True);
;
* Put up the requested start up logo ;
* Set #Logo uFileName(#Use_Logo) ;
Invoke #S_155FLG.uShow;
;
* Put out the starting message;
Message 'Data download in progress ..... please wait' type(*status);
;
* set up the form with data;
invoke #S_190RPL.uInit;
;
* Close the logo ;
Invoke #S_155FLG.uClose;
;
* Go into ready state ;
Set #S_155RST uStatusNumber(0) uBusy(False);
endif;
;
endroutine;
;
*;
* Poll has been selected, display the appropriate question list;
evtroutine handling(#S_190RPL.PollSelected);
* Set the status bar into a busy state ;
Set #S_155RST uBusy(True);
Message 'Loading poll details' Type(*status) ;
;
CLR_LIST #GRID_1;
change #S_190PID #S_190RPL.CurrPoll;
;
GROUP_BY NAME(#S_GRPPDF) FIELDS(#S_190PID #S_190PDS #S_190PPW #S_190PBN #S_190PST);
;
FETCH #S_GRPPDF SETPDF with_key(#S_190PID);
invoke #S_190RQL.uSetPollQues mS_190PID(#S_190PID) ;
;
* Enable or disable the question detail and response sections based on the poll status;
execute buttons with_parms('POLLSELECTED');
;
* Go into ready state ;
Set #S_155RST uBusy(False);
endroutine;
*;
* Poll details changed or new poll added;
evtroutine handling(#S_190FB.PollChangesSaved);
CHANGE #S_190PID #S_190FB.CurrPoll;
invoke #S_190RPL.uSetPoll mS_190PID(#S_190PID) ;
endroutine;
*;
* Poll deleted - rebuild list of polls;
evtroutine handling(#S_190FB.PollDeleted);
MESSAGE MSGTXT('Poll successfully deleted');
invoke #S_190RPL.uInit ;
endroutine;
*;
* Question has been selected;
EVTROUTINE HANDLING(#S_190RQL.QuestionSelected);
* If another question is selected, reflect it in the question details shown in this form;
change #S_190PQN #S_190RQL.CurrQuestion;
execute LOADQUES with_parms(#S_190PID #S_190PQN #S_190PQSQ);
;
* set buttons;
execute buttons with_parms('QUESSELECTED');
;
endroutine;
*;
* No question found for this poll;
EVTROUTINE HANDLING(#S_190RQL.NoQuestionFound);
* Clear all fields except #S_190PID when a question cannot be selected - e.g. after deletion of the last question in a poll, ;
* or new poll without any questions yet ;
CHANGE (#S_GRPPQUX #S_190PQN #S_190PQSQ) *NULL;
CLR_LIST #MEMO_1;
CLR_LIST #GRID_1;
invoke #S_190RQT.uSetQuestionType mS_190PQS(#S_190PQS);
;
* set buttons;
execute buttons with_parms('NOQUES');
;
endroutine;
*;
* Question Details have been changed;
EVTROUTINE HANDLING(#COM_OWNER.QuestionDetailsChgd);
* Enable the save and cancel buttons, and disable the list of polls and the list of questions until the user has saved;
* or cancelled their changes;
execute buttons with_parms('QUESEDIT');
ENDROUTINE;
;
* ;
* ----------------------------------------------------------------------------------------------------------------------------------------------;
* Question Maintenance Actions --------------------------------------------------------------------------------------------;
* ----------------------------------------------------------------------------------------------------------------------------------------------;
*;
;
*;
* Save Question Details ;
EVTROUTINE HANDLING(#PHBN_SAVE.Click);
;
* Set the status bar into a busy state ;
Set #S_155RST uBusy(True);
Message 'Validating save of question details' Type(*status) ;
;
GROUP_BY NAME(#S_GRPPQS) FIELDS(#S_190PID #S_190PQN #S_190PSN #S_190PSA #S_190PSL);
GROUP_BY NAME(#S_GRPPQSX) FIELDS(#S_190PSN #S_190PSA #S_190PSL);
*;
* Get the long question from the memo box;
GET_ENTRY 1 #MEMO_1;
;
* Validate that the entire question can be successfully saved;
BEGINCHECK;
CHECK_FOR SETPQU with_key(#S_190PID #S_190PQN);
IF_STATUS *EQUALKEY;
UPDATE FIELDS(#S_GRPPQU) IN_FILE(SETPQU) WITH_KEY(#S_190PID #S_190PQN) VAL_ERROR(*NEXT) CHECK_ONLY(*YES);
ELSE;
* Note that the file level parent-child validations for SETPQU-SETPQS have been relaxed ;
INSERT FIELDS(#S_GRPPQU) TO_FILE(SETPQU) VAL_ERROR(*NEXT) CHECK_ONLY(*YES);
ENDIF;
IF_ERROR;
else;
* Validate the list entries;
SELECTLIST #GRID_1;
IF_NULL (#S_190PSA #S_190PSL);
* note that numbered entries that are otherwise blank are ignored;
ELSE;
* validate - Note how the second begincheck/endcheck is necessary if validating a list of entries;
BEGINCHECK;
INSERT FIELDS(#S_GRPPQS) TO_FILE(SETPQS) VAL_ERROR(*NEXT) CHECK_ONLY(*YES);
* highlight entries in error;
UPD_ENTRY IN_LIST(#GRID_1);
ENDCHECK IF_ERROR(*NEXT);
ENDIF;
ENDSELECT;
endif;
;
IF_error;
* This logic is necessary if the busy light is used - it needs to be reset to green on error;
Set #S_155RST uBusy(FALSE);
endif;
ENDCHECK IF_ERROR(*RETURN);
;
* Now, if there are no validation errors, do the actual update;
CHECK_FOR SETPQU with_key(#S_190PID #S_190PQN);
IF_STATUS *EQUALKEY;
UPDATE FIELDS(#S_GRPPQU) IN_FILE(SETPQU) WITH_KEY(#S_190PID #S_190PQN) VAL_ERROR(*RETURN) ;
ELSE;
* Note that the parent-child validations for SETPQU-SETPQS have been relaxed ;
INSERT FIELDS(#S_GRPPQU) TO_FILE(SETPQU) VAL_ERROR(*RETURN) ;
ENDIF;
;
IF '#S_190PST *EQ DEFINE';
* get rid of any response data for polls in DEFINE status;
* (polls in other statuses can't be edited);
Message 'Clearing any response data (for poll in DEFINE status)' Type(*status) ;
DELETE SETPRA with_key(#S_190PID);
DELETE SETPRE with_key(#S_190PID);
ENDIF;
;
* Delete all pre-existing entries and insert the new entries;
Message 'Saving changes' Type(*status) ;
DELETE SETPQS with_key(#S_190PID #S_190PQN);
SELECTLIST #GRID_1;
IF_NULL ( #S_190PSA #S_190PSL);
* note that numbered entries that are otherwise blank are ignored;
ELSE;
INSERT FIELDS(#S_GRPPQS) TO_FILE(SETPQS) VAL_ERROR(*RETURN) ;
ENDIF;
ENDSELECT;
;
* refresh the list of questions for this poll, setting the focus to the current question;
invoke #S_190RQL.uSetPollQues mS_190PID(#S_190PID) mS_190PQN(#S_190PQN);
;
* If the update/insert was sucessful, reload from database;
execute LOADQUES with_parms(#S_190PID #S_190PQN #S_190PQSQ);
;
* set buttons;
execute buttons with_parms('QUESSAVE');
;
* Set the status bar into a ready state ;
Set #S_155RST uBusy(FALSE);
MESSAGE MSGTXT('Question details saved');
ENDROUTINE;
*;
* Cancel Question Details ;
EVTROUTINE HANDLING(#PHBN_CANC.Click);
* ReLoad details from file;
execute LOADQUES with_parms(#S_190PID #S_190PQN #S_190PQSQ);
;
* set buttons;
execute buttons with_parms('QUESSAVE');
ENDROUTINE;
*;
* New Question ;
EVTROUTINE HANDLING(#PHBN_NEWQ.Click);
* Get the next question identifier and default next question sequence;
CHANGE (#S_190PQN #S_190PQSQ) *NULL;
;
FETCH #S_190PQN SETPQUL1 with_key(#S_190PID);
CHANGE #S_190PQN '#S_190PQN + 1';
*;
FETCH #S_190PQSQ SETPQUL2 with_key(#S_190PID);
CHANGE #S_190PQSQ '#S_190PQSQ + 10';
;
execute LOADQUES with_parms(#S_190PID #S_190PQN #S_190PQSQ);
;
* set the focus to a new blank entry on the list of questions ;
invoke #S_190RQL.uSetQuestion mS_190PQN(#S_190PQN);
;
* set buttons;
execute buttons with_parms('QUESEDIT');
ENDROUTINE;
*;
* Delete question;
EVTROUTINE HANDLING(#PHBN_DELQ.Click);
;
BEGINCHECK;
* Note that the parent-child validations for SETPQU-SETPQS have been relaxed ;
DELETE SETPQS with_key(#S_190PID #S_190PQN) CHECK_ONLY(*YES);
DELETE SETPQU with_key(#S_190PID #S_190PQN) CHECK_ONLY(*YES);
ENDCHECK;
;
DELETE SETPQS with_key(#S_190PID #S_190PQN) ;
DELETE SETPQU with_key(#S_190PID #S_190PQN) ;
;
* refresh the list of questions for this poll, setting the focus to the first question (if it exists);
MESSAGE MSGTXT('Question successfully deleted');
invoke #S_190RQL.uSetPollQues mS_190PID(#S_190PID) mS_190PQN(0);
;
ENDROUTINE;
*;
* Display a question's details from file. If the question does not exist yet, display as for a new question ;
Subroutine LOADQUES parms(#S_190PID #S_190PQN #S_190PQSQ);
;
* If the question exists on file, the question sequence from the file overrides ;
* If the question does not exist on file, the passed question sequence will be used ;
;
GROUP_BY NAME(#S_GRPPQUX) FIELDS(#S_190PQA #S_190PQL #S_190PQS );
GROUP_BY NAME(#S_GRPPQU) FIELDS(#S_190PID #S_190PQN #S_190PQSQ #S_190PQA #S_190PQL #S_190PQS);
*;
CHANGE #S_GRPPQUX *NULL;
FETCH #S_GRPPQU SETPQU with_key(#S_190PID #S_190PQN);
*;
* set the radio buttons according to the question type;
invoke #S_190RQT.uSetQuestionType mS_190PQS(#S_190PQS);
*;
* display the question text;
CLR_LIST #MEMO_1;
ADD_ENTRY #MEMO_1;
*;
* build the list of possible selections;
CLR_LIST #GRID_1;
SELECT #S_GRPPQSX SETPQS with_key(#S_190PID #S_190PQN);
ADD_entry #GRID_1;
endselect;
*;
* adjust the list of responses based on the question type;
execute QUESTYPE with_parms(#S_190PQS #S_190PSN);
;
endroutine;
*;
* Set read-only, visibility and additional blank options, according to the question type;
subroutine QUESTYPE parms(#S_190PQS #S_190PSN);
* #S_190PSN holds the last selection that this question currently has ;
;
CASE #S_190PQS;
WHEN VALUE_IS('= ANSWER' '= YESNO' '= YESNOUNK');
* Yes or No (or Unk), or free format answer;
* The possible responses list is not editable ;
set (#GDCL_1 #GDCL_2 #GDCL_3) ReadOnly(TRUE);
;
WHEN VALUE_IS('= SELECT' '= MSELECT' '= RANK');
* Select one from, or rank many options;
* The possible responses list is editable;
set (#GDCL_1 #GDCL_2 #GDCL_3) ReadOnly(FALSE);
* add another 10 numbered blank possible responses;
CHANGE (#S_190PSA #S_190PSL) *NULL;
BEGIN_LOOP TO(10);
CHANGE #S_190PSN '#S_190PSN + 1';
ADD_ENTRY #GRID_1;
END_LOOP;
OTHERWISE;
* Question Type is not known yet - display empty list;
ENDCASE;
ENDROUTINE;
*;
* The user has changed the question type;
EVTROUTINE HANDLING(#S_190RQT.Changed) OPTIONS(*NOCLEARMESSAGES *NOCLEARERRORS);
CLR_LIST #GRID_1;
CHANGE #S_GRPPQSX *NULL;
CHANGE #S_190PQS #S_190RQT.uQuestionType;
CASE #S_190PQS;
WHEN '= ANSWER';
* free format answer;
* add one list entry;
execute AddResp with_parms(1 '''Free Format''');
;
WHEN VALUE_IS('= YESNO' );
* Yes or No ;
* add yes and no selections;
;
execute AddResp with_parms(1 '''Yes''');
execute AddResp with_parms(2 '''No''');
;
WHEN VALUE_IS('= YESNO' '= YESNOUNK');
* Yes or No or Unk;
* add yes, no, unknown selections;
execute AddResp with_parms(1 '''Yes''');
execute AddResp with_parms(2 '''No''');
execute AddResp with_parms(3 '''Unknown''');
;
WHEN VALUE_IS('= SELECT' '= MSELECT' '= RANK');
* Select one (or many) from many options, or rank many options;
* the QUESTYPE subroutine will add 10 numbered blank entries;
OTHERWISE;
* Question Type is not known yet;
ENDCASE;
;
* adjust the list of responses based on the question type;
execute QUESTYPE with_parms(#S_190PQS #S_190PSN);
;
signal QuestionDetailsChgd;
endroutine;
*;
* Adds an entry to the list of possible responses ;
Subroutine AddResp parms(#S_190PSN #S_190PSA);
CHANGE #S_190PSL #S_190PSA;
ADD_ENTRY TO_LIST(#GRID_1);
endroutine;
*;
* The user has made a change to the list of responses, or other question details;
EVTROUTINE HANDLING(#GRID_1.ItemChanged #S_190PQA.Changed #MEMO_1.Changed #S_190PQSQ.Changed) OPTIONS(*NOCLEARMESSAGES *NOCLEARERRORS);
signal QuestionDetailsChgd;
ENDROUTINE;
*;
* The user has requested a breakdown of the responses to this question;
EVTROUTINE HANDLING(#MITM_QBRK.Click);
* Set the status bar into a busy state ;
Set #S_155RST uBusy(True);
;
CASE #S_190PQS;
WHEN '= RANK';
invoke #S_190FI.uShowQuesBreakdown mS_190PID(#S_190PID) mS_190PQN(#S_190PQN);
WHEN '= ANSWER';
invoke #S_190FJ.uShowQuesBreakdown mS_190PID(#S_190PID) mS_190PQN(#S_190PQN);
OTHERWISE;
invoke #S_190FF.uShowQuesBreakdown mS_190PID(#S_190PID) mS_190PQN(#S_190PQN);
ENDCASE;
;
* Set the status bar into a ready state ;
Set #S_155RST uBusy(FALSE);
ENDROUTINE;
*;
* The user wants to investigate whether there is a relationship between the responses for two questions;
EVTROUTINE HANDLING(#MITM_QREL.Click);
* Set the status bar into a busy state ;
Set #S_155RST uBusy(True);
;
invoke #S_190FG.uQuesRelationship mS_190PID(#S_190PID) mS_190PQN(#S_190PQN);
;
* Set the status bar into a ready state ;
Set #S_155RST uBusy(True);
ENDROUTINE;
* ;
* --------------------------------------------------------------------------------------------------------------------------------------;
* Poll Maintenance Actions --------------------------------------------------------------------------------------------;
* --------------------------------------------------------------------------------------------------------------------------------------;
*;
;
*New Poll ;
EVTROUTINE HANDLING(#PHBN_NEWP.Click #MITM_NEWP.Click);
CHANGE #S_ACTIONX NEW;
invoke #S_190FB.uShowPoll mS_190PID(#S_190PID) mS_ACTIONX(#S_ACTIONX);
ENDROUTINE;
*;
* Delete selected poll;
EVTROUTINE HANDLING(#PHBN_DELP.Click #MITM_DELP.Click);
CHANGE #S_ACTIONX DELETE;
invoke #S_190FB.uShowPoll mS_190PID(#S_190PID) mS_ACTIONX(#S_ACTIONX);
ENDROUTINE;
*;
* Close Poll;
EVTROUTINE HANDLING(#MITM_CLSP.Click);
CHANGE #S_ACTIONX CLOSE;
invoke #S_190FB.uShowPoll mS_190PID(#S_190PID) mS_ACTIONX(#S_ACTIONX);
ENDROUTINE;
*;
* Edit Poll;
EVTROUTINE HANDLING(#MITM_EDTP.Click);
CHANGE #S_ACTIONX EDIT;
invoke #S_190FB.uShowPoll mS_190PID(#S_190PID) mS_ACTIONX(#S_ACTIONX);
ENDROUTINE;
*;
* Open Poll;
EVTROUTINE HANDLING(#MITM_OPNP.Click);
CHANGE #S_ACTIONX OPEN;
invoke #S_190FB.uShowPoll mS_190PID(#S_190PID) mS_ACTIONX(#S_ACTIONX);
ENDROUTINE;
*;
* Run Poll;
EVTROUTINE HANDLING(#MITM_RUNP.Click);
* Build URL for this poll;
DEFINE #S_190PIDC *CHAR 15;
USE BUILTIN(NUMERIC_STRING) WITH_ARGS(#S_190PID) TO_GET(#S_190PIDC);
;
USE BUILTIN(TCONCAT) WITH_ARGS(*S_URLPORT *S_FIXEDURLPART 'SET_190+SET190A+' *PARTITION) TO_GET(#S_URLPORT);
;
USE BUILTIN(TCONCAT) WITH_ARGS(#S_URLPORT '+FUNCPARMS+STDRENTRY(A0010):P+S_190PID(P0150):' #S_190PIDC) TO_GET(#S_URLPORT);
;
USE BUILTIN(SYSTEM_COMMAND) WITH_ARGS(H #S_URLPORT) TO_GET(#STD_IDNO);
ENDROUTINE;
* ;
* --------------------------------------------------------------------------------------------------------------------------------------;
* General Purpose Routines --------------------------------------------------------------------------------------------;
* ---------------------------------------------------------------------------------------------------------------------------------------;
*;
;
*;
* Enable the buttons and group boxes according to the poll status and the action;
subroutine buttons parms(#S_190BTN);
DEFINE #S_190BTN *CHAR 20;
;
CASE #S_190PST;
WHEN '= DEFINE';
* Poll questions can be edited, poll can be edited run or opened, but not closed;
CASE #S_190BTN;
WHEN '= POLLSELECTED';
* poll selected;
set (#GPBX_QUESDET #GPBX_RESP #PHBN_DELP #MITM_DELP #PHBN_NEWP #MITM_NEWP #PHBN_NEWQ) Enabled(TRUE);
set (#MITM_OPNP #MITM_RUNP #MITM_EDTP) enabled(TRUE);
set (#MITM_CLSP ) enabled(FALSE);
WHEN '= QUESSELECTED';
* question selected;
set #PHBN_DELQ enabled(TRUE);
WHEN '= QUESEDIT';
* while editing a question or adding a new question no other changes can be made;
set (#PHBN_SAVE #PHBN_CANC) enabled(TRUE);
set (#GPBX_POLL #GPBX_QUESLST #PHBN_NEWP #PHBN_DELP #MITM_DELP #PHBN_NEWQ #MITM_NEWP #PHBN_DELQ) enabled(FALSE);
;
WHEN '= QUESSAVE';
* question saved, or changes cancelled;
set (#PHBN_SAVE #PHBN_CANC) enabled(FALSE);
set (#GPBX_POLL #GPBX_QUESLST #PHBN_NEWP #PHBN_DELP #MITM_DELP #PHBN_NEWQ #MITM_NEWP #PHBN_DELQ) enabled(TRUE);
WHEN '= NOQUES';
* there are no questions for this poll;
set (#PHBN_NEWQ ) enabled(TRUE);
set (#PHBN_DELQ) enabled(FALSE);
ENDCASE;
WHEN VALUE_IS('= CLOSED');
* Poll questions cannot be edited, poll cannot be run, but poll can be edited or re-opened or deleted;
CASE #S_190BTN;
WHEN '= POLLSELECTED';
set (#PHBN_NEWP #MITM_NEWP #PHBN_DELP #MITM_DELP) Enabled(TRUE);
set (#GPBX_QUESDET #GPBX_RESP #PHBN_NEWQ #PHBN_DELQ ) Enabled(FALSE);
;
set (#MITM_OPNP #MITM_EDTP) enabled(TRUE);
set (#MITM_CLSP #MITM_RUNP ) enabled(FALSE);
ENDCASE;
WHEN '= OPEN';
* Poll questions cannot be edited, poll can be edited, closed or run ;
CASE #S_190BTN;
WHEN '= POLLSELECTED';
set (#PHBN_NEWP #MITM_NEWP) Enabled(TRUE);
set (#GPBX_QUESDET #GPBX_RESP #PHBN_NEWQ #PHBN_DELQ #PHBN_DELP #MITM_DELP) Enabled(FALSE);
;
set (#MITM_CLSP #MITM_RUNP #MITM_EDTP) enabled(TRUE);
set (#MITM_OPNP ) enabled(FALSE);
ENDCASE;
ENDCASE;
endroutine;
*;
* Disconnect;
EVTROUTINE HANDLING( #Com_Owner.Closing);
invoke #VL_SAM003.uDisconnect;
;
* Disable all options until the user connects to the AS/400;
;
set (#PHBN_NEWP #MITM_NEWP #PHBN_DELP #MITM_DELP) Enabled(FALSE);
set (#GPBX_QUESDET #GPBX_RESP #PHBN_NEWQ #PHBN_DELQ ) Enabled(FALSE);
set (#MITM_OPNP #MITM_EDTP) enabled(FALSE);
set (#MITM_CLSP #MITM_RUNP ) enabled(FALSE);
;
ENDROUTINE;
* ;
* Information Message ;
SUBROUTINE INFMESSAGE((#EX_TEXT *RECEIVED));
define #ex_text *char 132;
message msgid(dcm9992) msgf(dc@m01) msgdta(#ex_text *blanks);
ENDROUTINE;
END_COM;
;
*===================================================================;
*;
* Component : S_190FA;
* Type : Form;
* Ancestor : PRIM_FORM (Primitive Form);
*;
* Description : Poll Questions; ;
*;
* Full Description; This form allows maintenance of questions and responses to questions.;
* Polls can be run as the user would run them; ;
* From this form there are links to poll creation and maintenance and ;
* also to analysis of responses to 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 FRAMESTYLE(Single) HEIGHT(727) LAYOUTMANAGER(#FWLM_3) LEFT(148) TOP(3) VISUALSTYLE(#VS_NORM) WIDTH(614);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_1) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_QUESDET) CAPTION('Question details') DISPLAYPOSITION(3) HEIGHT(225) LEFT(-1) PARENT(#COM_OWNER) TABPOSITION(1) TABSTOP(False) TOP(262) WIDTH(609);
DEFINE_COM CLASS(#PRIM_MEMO) NAME(#MEMO_1) ADDENTRYMODE(MultiplePerLine) CURRENTLINE(1) DISPLAYPOSITION(2) HEIGHT(93) LEFT(192) MAXIMUMLINELENGTH(256) MAXIMUMLINES(1) PARENT(#GPBX_QUESDET) TABPOSITION(3) TOP(80) WIDTH(321) WORDWRAP(True);
DEFINE_COM CLASS(#S_190PQA.Visual) NAME(#S_190PQA) DISPLAYPOSITION(3) HEIGHT(19) LEFT(192) PARENT(#GPBX_QUESDET) TABPOSITION(2) TOP(48) WIDTH(321);
DEFINE_COM CLASS(#PRIM_MECL) NAME(#MECL_1) COLUMNROLE(Data) DISPLAYPOSITION(1) PARENT(#MEMO_1) SOURCE(#S_190PQL) WIDTH(20);
DEFINE_COM CLASS(#VL_SAM003) NAME(#VL_SAM003);
DEFINE_COM CLASS(#S_190RQT) NAME(#S_190RQT) LEFT(16) PARENT(#GPBX_QUESDET) TABPOSITION(4) TABSTOP(False) TOP(16);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_RESP) CAPTION('Possible Responses') DISPLAYPOSITION(4) HEIGHT(156) LEFT(-1) PARENT(#COM_OWNER) TABPOSITION(2) TABSTOP(False) TOP(498) WIDTH(609);
DEFINE_COM CLASS(#PRIM_GRID) NAME(#GRID_1) DISPLAYPOSITION(1) HEIGHT(129) LEFT(16) PARENT(#GPBX_RESP) ROWHEIGHT(18) TABPOSITION(1) TOP(16) WIDTH(569);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_1) CAPTION('Number') CAPTIONTYPE(Caption) DISPLAYPOSITION(1) PARENT(#GRID_1) SOURCE(#S_190PSN) WIDTH(10);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_2) CAPTION('Abbrev. Selection ') CAPTIONTYPE(Caption) DISPLAYPOSITION(2) PARENT(#GRID_1) READONLY(False) SOURCE(#S_190PSA) WIDTH(20);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_3) DISPLAYPOSITION(3) PARENT(#GRID_1) READONLY(False) SOURCE(#S_190PSL) WIDTH(20) WIDTHTYPE(Remainder);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_2) FLOWOPERATION(Center) FLOWOPERATIONHOR(Spread);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_SAVE) DISPLAYPOSITION(4) ENABLED(False) HEIGHT(33) HINT('Save Question and responses') IMAGE(#VB_SAVE) LEFT(536) PARENT(#GPBX_QUESDET) TABPOSITION(5) TOP(24) WIDTH(40);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_CANC) DISPLAYPOSITION(5) ENABLED(False) HEIGHT(33) HINT('Cancel changes') IMAGE(#VB_UNDO) LEFT(536) PARENT(#GPBX_QUESDET) TABPOSITION(6) TOP(64) WIDTH(40);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_3) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread) SPACING(0) SPACINGITEMS(0);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_4) MANAGE(#GPBX_QUESDET) PARENT(#FWLM_3);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_5) MANAGE(#GPBX_RESP) PARENT(#FWLM_3);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_POLL) CAPTION('List of Polls') DISPLAYPOSITION(1) HEIGHT(111) LAYOUTMANAGER(#ATLM_1) LEFT(-1) PARENT(#COM_OWNER) TABPOSITION(3) TABSTOP(False) TOP(11) WIDTH(609);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_7) MANAGE(#GPBX_POLL) PARENT(#FWLM_3);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_QUESLST) CAPTION('List of Questions') DISPLAYPOSITION(2) HEIGHT(118) LAYOUTMANAGER(#ATLM_2) LEFT(-1) PARENT(#COM_OWNER) TABPOSITION(4) TABSTOP(False) TOP(133) WIDTH(609);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_8) MANAGE(#GPBX_QUESLST) PARENT(#FWLM_3);
DEFINE_COM CLASS(#S_190RPL) NAME(#S_190RPL) HEIGHT(94) LEFT(4) PARENT(#GPBX_POLL) POPUPMENU(#PMNU_POLL) TABSTOP(False) TOP(13) WIDTH(532);
DEFINE_COM CLASS(#S_190RQL) NAME(#S_190RQL) HEIGHT(101) LEFT(4) PARENT(#GPBX_QUESLST) POPUPMENU(#PMNU_QUES) TABSTOP(False) TOP(13) WIDTH(532);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_1);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_1) ATTACHMENT(Center) MANAGE(#S_190RPL) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_2);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_2) ATTACHMENT(Center) MANAGE(#S_190RQL) PARENT(#ATLM_2);
DEFINE_COM CLASS(#S_190PQSQ.Visual) NAME(#S_190PQSQ) DISPLAYPOSITION(6) HEIGHT(19) LEFT(192) PARENT(#GPBX_QUESDET) TABPOSITION(1) TOP(24) WIDTH(209);
DEFINE_COM CLASS(#PRIM_PMNU) NAME(#PMNU_POLL);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_NEWP) CAPTION('New Poll') DISPLAYPOSITION(1) PARENT(#PMNU_POLL);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_EDTP) CAPTION('Edit Poll') DISPLAYPOSITION(2) PARENT(#PMNU_POLL);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_DELP) CAPTION('Delete Poll') DISPLAYPOSITION(3) PARENT(#PMNU_POLL);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_CLSP) CAPTION('Close Poll') DISPLAYPOSITION(5) PARENT(#PMNU_POLL);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_RUNP) CAPTION('Run Poll') DISPLAYPOSITION(6) PARENT(#PMNU_POLL);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_OPNP) CAPTION('Open Poll') DISPLAYPOSITION(4) PARENT(#PMNU_POLL);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_1) DISPLAYPOSITION(2) HEIGHT(94) LAYOUTMANAGER(#FWLM_4) LEFT(536) PARENT(#GPBX_POLL) TABPOSITION(2) TABSTOP(False) TOP(13) WIDTH(69);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_5) ATTACHMENT(Right) MANAGE(#PANL_1) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_4) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_NEWP) DISPLAYPOSITION(1) HEIGHT(33) HINT('New Poll') IMAGE(#VB_NEW) LEFT(14) PARENT(#PANL_1) TABPOSITION(1) TOP(6) WIDTH(40);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_1) MANAGE(#PHBN_NEWP) PARENT(#FWLM_4);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_DELP) DISPLAYPOSITION(2) HEIGHT(33) HINT('Delete Poll') IMAGE(#VB_DELETE) LEFT(14) PARENT(#PANL_1) TABPOSITION(2) TOP(55) WIDTH(40);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_2) MANAGE(#PHBN_DELP) PARENT(#FWLM_4);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_2) DISPLAYPOSITION(2) HEIGHT(101) LAYOUTMANAGER(#FWLM_5) LEFT(536) PARENT(#GPBX_QUESLST) TABPOSITION(2) TABSTOP(False) TOP(13) WIDTH(69);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_6) ATTACHMENT(Right) MANAGE(#PANL_2) PARENT(#ATLM_2);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_5) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_NEWQ) DISPLAYPOSITION(1) HEIGHT(33) HINT('New Question') IMAGE(#VB_NEW) LEFT(14) PARENT(#PANL_2) TABPOSITION(1) TOP(8) WIDTH(40);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_3) MANAGE(#PHBN_NEWQ) PARENT(#FWLM_5);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_DELQ) DISPLAYPOSITION(2) HEIGHT(33) HINT('Delete Question') IMAGE(#VB_DELETE) LEFT(14) PARENT(#PANL_2) TABPOSITION(2) TOP(59) WIDTH(40);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_9) MANAGE(#PHBN_DELQ) PARENT(#FWLM_5);
DEFINE_COM CLASS(#S_190FB) NAME(#S_190FB);
DEFINE_COM CLASS(#S_190FF) NAME(#S_190FF);
DEFINE_COM CLASS(#PRIM_PMNU) NAME(#PMNU_QUES);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_QBRK) CAPTION('Breakdown of responses') DISPLAYPOSITION(1) PARENT(#PMNU_QUES);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_QREL) CAPTION('Relationship between responses for two questions') DISPLAYPOSITION(2) PARENT(#PMNU_QUES);
DEFINE_COM CLASS(#S_190FG) NAME(#S_190FG);
DEFINE_COM CLASS(#S_190FI) NAME(#S_190FI);
DEFINE_COM CLASS(#S_190FJ) NAME(#S_190FJ);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_10) MANAGE(#S_155RST) PARENT(#FWLM_3);
DEFINE_COM CLASS(#S_155FLG) NAME(#S_155FLG);
DEFINE_COM CLASS(#PRIM_STBR) NAME(#STBR_1) DISPLAYPOSITION(5) HEIGHT(24) LEFT(0) MESSAGEPOSITION(1) PARENT(#COM_OWNER) TABPOSITION(5) TABSTOP(False) TOP(676) WIDTH(606);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_6) MANAGE(#STBR_1) PARENT(#FWLM_3);
DEFINE_COM CLASS(#S_155RST) NAME(#S_155RST) HEIGHT(18) LEFT(367) PARENT(#STBR_1) TABSTOP(False) TOP(4) WIDTH(237);
;
define_evt QuestionDetailsChgd help('This event is signaled when the user has made changes to the details of a question, including changes to the possible responses ');
;
;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption(*component_desc);
;
* Disable all options until the user connects to the AS/400;
;
set (#PHBN_NEWP #MITM_NEWP #PHBN_DELP #MITM_DELP) Enabled(FALSE);
set (#GPBX_QUESDET #GPBX_RESP #PHBN_NEWQ #PHBN_DELQ ) Enabled(FALSE);
set (#MITM_OPNP #MITM_EDTP) enabled(FALSE);
set (#MITM_CLSP #MITM_RUNP ) enabled(FALSE);
;
invoke #VL_SAM003.uConnectModal;
if '*sserver_type *ne AS400';
invoke #COM_Owner.CloseForm;
else;
;
* Enable new poll option regardless of whether a poll gets selection ;
set (#PHBN_NEWP) Enabled(TRUE);
;
* Remove status bar fields that are not needed;
Set #S_155RST uShowDate(FALSE) uStatusText(' ') uStatusNumber(0);
;
* Set the status bar into a busy state ;
Set #S_155RST uBusy(True);
;
* Put up the requested start up logo ;
* Set #Logo uFileName(#Use_Logo) ;
Invoke #S_155FLG.uShow;
;
* Put out the starting message;
Message 'Data download in progress ..... please wait' type(*status);
;
* set up the form with data;
invoke #S_190RPL.uInit;
;
* Close the logo ;
Invoke #S_155FLG.uClose;
;
* Go into ready state ;
Set #S_155RST uStatusNumber(0) uBusy(False);
endif;
;
endroutine;
;
*;
* Poll has been selected, display the appropriate question list;
evtroutine handling(#S_190RPL.PollSelected);
* Set the status bar into a busy state ;
Set #S_155RST uBusy(True);
Message 'Loading poll details' Type(*status) ;
;
CLR_LIST #GRID_1;
change #S_190PID #S_190RPL.CurrPoll;
;
GROUP_BY NAME(#S_GRPPDF) FIELDS(#S_190PID #S_190PDS #S_190PPW #S_190PBN #S_190PST);
;
FETCH #S_GRPPDF SETPDF with_key(#S_190PID);
invoke #S_190RQL.uSetPollQues mS_190PID(#S_190PID) ;
;
* Enable or disable the question detail and response sections based on the poll status;
execute buttons with_parms('POLLSELECTED');
;
* Go into ready state ;
Set #S_155RST uBusy(False);
endroutine;
*;
* Poll details changed or new poll added;
evtroutine handling(#S_190FB.PollChangesSaved);
CHANGE #S_190PID #S_190FB.CurrPoll;
invoke #S_190RPL.uSetPoll mS_190PID(#S_190PID) ;
endroutine;
*;
* Poll deleted - rebuild list of polls;
evtroutine handling(#S_190FB.PollDeleted);
MESSAGE MSGTXT('Poll successfully deleted');
invoke #S_190RPL.uInit ;
endroutine;
*;
* Question has been selected;
EVTROUTINE HANDLING(#S_190RQL.QuestionSelected);
* If another question is selected, reflect it in the question details shown in this form;
change #S_190PQN #S_190RQL.CurrQuestion;
execute LOADQUES with_parms(#S_190PID #S_190PQN #S_190PQSQ);
;
* set buttons;
execute buttons with_parms('QUESSELECTED');
;
endroutine;
*;
* No question found for this poll;
EVTROUTINE HANDLING(#S_190RQL.NoQuestionFound);
* Clear all fields except #S_190PID when a question cannot be selected - e.g. after deletion of the last question in a poll, ;
* or new poll without any questions yet ;
CHANGE (#S_GRPPQUX #S_190PQN #S_190PQSQ) *NULL;
CLR_LIST #MEMO_1;
CLR_LIST #GRID_1;
invoke #S_190RQT.uSetQuestionType mS_190PQS(#S_190PQS);
;
* set buttons;
execute buttons with_parms('NOQUES');
;
endroutine;
*;
* Question Details have been changed;
EVTROUTINE HANDLING(#COM_OWNER.QuestionDetailsChgd);
* Enable the save and cancel buttons, and disable the list of polls and the list of questions until the user has saved;
* or cancelled their changes;
execute buttons with_parms('QUESEDIT');
ENDROUTINE;
;
* ;
* ----------------------------------------------------------------------------------------------------------------------------------------------;
* Question Maintenance Actions --------------------------------------------------------------------------------------------;
* ----------------------------------------------------------------------------------------------------------------------------------------------;
*;
;
*;
* Save Question Details ;
EVTROUTINE HANDLING(#PHBN_SAVE.Click);
;
* Set the status bar into a busy state ;
Set #S_155RST uBusy(True);
Message 'Validating save of question details' Type(*status) ;
;
GROUP_BY NAME(#S_GRPPQS) FIELDS(#S_190PID #S_190PQN #S_190PSN #S_190PSA #S_190PSL);
GROUP_BY NAME(#S_GRPPQSX) FIELDS(#S_190PSN #S_190PSA #S_190PSL);
*;
* Get the long question from the memo box;
GET_ENTRY 1 #MEMO_1;
;
* Validate that the entire question can be successfully saved;
BEGINCHECK;
CHECK_FOR SETPQU with_key(#S_190PID #S_190PQN);
IF_STATUS *EQUALKEY;
UPDATE FIELDS(#S_GRPPQU) IN_FILE(SETPQU) WITH_KEY(#S_190PID #S_190PQN) VAL_ERROR(*NEXT) CHECK_ONLY(*YES);
ELSE;
* Note that the file level parent-child validations for SETPQU-SETPQS have been relaxed ;
INSERT FIELDS(#S_GRPPQU) TO_FILE(SETPQU) VAL_ERROR(*NEXT) CHECK_ONLY(*YES);
ENDIF;
IF_ERROR;
else;
* Validate the list entries;
SELECTLIST #GRID_1;
IF_NULL (#S_190PSA #S_190PSL);
* note that numbered entries that are otherwise blank are ignored;
ELSE;
* validate - Note how the second begincheck/endcheck is necessary if validating a list of entries;
BEGINCHECK;
INSERT FIELDS(#S_GRPPQS) TO_FILE(SETPQS) VAL_ERROR(*NEXT) CHECK_ONLY(*YES);
* highlight entries in error;
UPD_ENTRY IN_LIST(#GRID_1);
ENDCHECK IF_ERROR(*NEXT);
ENDIF;
ENDSELECT;
endif;
;
IF_error;
* This logic is necessary if the busy light is used - it needs to be reset to green on error;
Set #S_155RST uBusy(FALSE);
endif;
ENDCHECK IF_ERROR(*RETURN);
;
* Now, if there are no validation errors, do the actual update;
CHECK_FOR SETPQU with_key(#S_190PID #S_190PQN);
IF_STATUS *EQUALKEY;
UPDATE FIELDS(#S_GRPPQU) IN_FILE(SETPQU) WITH_KEY(#S_190PID #S_190PQN) VAL_ERROR(*RETURN) ;
ELSE;
* Note that the parent-child validations for SETPQU-SETPQS have been relaxed ;
INSERT FIELDS(#S_GRPPQU) TO_FILE(SETPQU) VAL_ERROR(*RETURN) ;
ENDIF;
;
IF '#S_190PST *EQ DEFINE';
* get rid of any response data for polls in DEFINE status;
* (polls in other statuses can't be edited);
Message 'Clearing any response data (for poll in DEFINE status)' Type(*status) ;
DELETE SETPRA with_key(#S_190PID);
DELETE SETPRE with_key(#S_190PID);
ENDIF;
;
* Delete all pre-existing entries and insert the new entries;
Message 'Saving changes' Type(*status) ;
DELETE SETPQS with_key(#S_190PID #S_190PQN);
SELECTLIST #GRID_1;
IF_NULL ( #S_190PSA #S_190PSL);
* note that numbered entries that are otherwise blank are ignored;
ELSE;
INSERT FIELDS(#S_GRPPQS) TO_FILE(SETPQS) VAL_ERROR(*RETURN) ;
ENDIF;
ENDSELECT;
;
* refresh the list of questions for this poll, setting the focus to the current question;
invoke #S_190RQL.uSetPollQues mS_190PID(#S_190PID) mS_190PQN(#S_190PQN);
;
* If the update/insert was sucessful, reload from database;
execute LOADQUES with_parms(#S_190PID #S_190PQN #S_190PQSQ);
;
* set buttons;
execute buttons with_parms('QUESSAVE');
;
* Set the status bar into a ready state ;
Set #S_155RST uBusy(FALSE);
MESSAGE MSGTXT('Question details saved');
ENDROUTINE;
*;
* Cancel Question Details ;
EVTROUTINE HANDLING(#PHBN_CANC.Click);
* ReLoad details from file;
execute LOADQUES with_parms(#S_190PID #S_190PQN #S_190PQSQ);
;
* set buttons;
execute buttons with_parms('QUESSAVE');
ENDROUTINE;
*;
* New Question ;
EVTROUTINE HANDLING(#PHBN_NEWQ.Click);
* Get the next question identifier and default next question sequence;
CHANGE (#S_190PQN #S_190PQSQ) *NULL;
;
FETCH #S_190PQN SETPQUL1 with_key(#S_190PID);
CHANGE #S_190PQN '#S_190PQN + 1';
*;
FETCH #S_190PQSQ SETPQUL2 with_key(#S_190PID);
CHANGE #S_190PQSQ '#S_190PQSQ + 10';
;
execute LOADQUES with_parms(#S_190PID #S_190PQN #S_190PQSQ);
;
* set the focus to a new blank entry on the list of questions ;
invoke #S_190RQL.uSetQuestion mS_190PQN(#S_190PQN);
;
* set buttons;
execute buttons with_parms('QUESEDIT');
ENDROUTINE;
*;
* Delete question;
EVTROUTINE HANDLING(#PHBN_DELQ.Click);
;
BEGINCHECK;
* Note that the parent-child validations for SETPQU-SETPQS have been relaxed ;
DELETE SETPQS with_key(#S_190PID #S_190PQN) CHECK_ONLY(*YES);
DELETE SETPQU with_key(#S_190PID #S_190PQN) CHECK_ONLY(*YES);
ENDCHECK;
;
DELETE SETPQS with_key(#S_190PID #S_190PQN) ;
DELETE SETPQU with_key(#S_190PID #S_190PQN) ;
;
* refresh the list of questions for this poll, setting the focus to the first question (if it exists);
MESSAGE MSGTXT('Question successfully deleted');
invoke #S_190RQL.uSetPollQues mS_190PID(#S_190PID) mS_190PQN(0);
;
ENDROUTINE;
*;
* Display a question's details from file. If the question does not exist yet, display as for a new question ;
Subroutine LOADQUES parms(#S_190PID #S_190PQN #S_190PQSQ);
;
* If the question exists on file, the question sequence from the file overrides ;
* If the question does not exist on file, the passed question sequence will be used ;
;
GROUP_BY NAME(#S_GRPPQUX) FIELDS(#S_190PQA #S_190PQL #S_190PQS );
GROUP_BY NAME(#S_GRPPQU) FIELDS(#S_190PID #S_190PQN #S_190PQSQ #S_190PQA #S_190PQL #S_190PQS);
*;
CHANGE #S_GRPPQUX *NULL;
FETCH #S_GRPPQU SETPQU with_key(#S_190PID #S_190PQN);
*;
* set the radio buttons according to the question type;
invoke #S_190RQT.uSetQuestionType mS_190PQS(#S_190PQS);
*;
* display the question text;
CLR_LIST #MEMO_1;
ADD_ENTRY #MEMO_1;
*;
* build the list of possible selections;
CLR_LIST #GRID_1;
SELECT #S_GRPPQSX SETPQS with_key(#S_190PID #S_190PQN);
ADD_entry #GRID_1;
endselect;
*;
* adjust the list of responses based on the question type;
execute QUESTYPE with_parms(#S_190PQS #S_190PSN);
;
endroutine;
*;
* Set read-only, visibility and additional blank options, according to the question type;
subroutine QUESTYPE parms(#S_190PQS #S_190PSN);
* #S_190PSN holds the last selection that this question currently has ;
;
CASE #S_190PQS;
WHEN VALUE_IS('= ANSWER' '= YESNO' '= YESNOUNK');
* Yes or No (or Unk), or free format answer;
* The possible responses list is not editable ;
set (#GDCL_1 #GDCL_2 #GDCL_3) ReadOnly(TRUE);
;
WHEN VALUE_IS('= SELECT' '= MSELECT' '= RANK');
* Select one from, or rank many options;
* The possible responses list is editable;
set (#GDCL_1 #GDCL_2 #GDCL_3) ReadOnly(FALSE);
* add another 10 numbered blank possible responses;
CHANGE (#S_190PSA #S_190PSL) *NULL;
BEGIN_LOOP TO(10);
CHANGE #S_190PSN '#S_190PSN + 1';
ADD_ENTRY #GRID_1;
END_LOOP;
OTHERWISE;
* Question Type is not known yet - display empty list;
ENDCASE;
ENDROUTINE;
*;
* The user has changed the question type;
EVTROUTINE HANDLING(#S_190RQT.Changed) OPTIONS(*NOCLEARMESSAGES *NOCLEARERRORS);
CLR_LIST #GRID_1;
CHANGE #S_GRPPQSX *NULL;
CHANGE #S_190PQS #S_190RQT.uQuestionType;
CASE #S_190PQS;
WHEN '= ANSWER';
* free format answer;
* add one list entry;
execute AddResp with_parms(1 '''Free Format''');
;
WHEN VALUE_IS('= YESNO' );
* Yes or No ;
* add yes and no selections;
;
execute AddResp with_parms(1 '''Yes''');
execute AddResp with_parms(2 '''No''');
;
WHEN VALUE_IS('= YESNO' '= YESNOUNK');
* Yes or No or Unk;
* add yes, no, unknown selections;
execute AddResp with_parms(1 '''Yes''');
execute AddResp with_parms(2 '''No''');
execute AddResp with_parms(3 '''Unknown''');
;
WHEN VALUE_IS('= SELECT' '= MSELECT' '= RANK');
* Select one (or many) from many options, or rank many options;
* the QUESTYPE subroutine will add 10 numbered blank entries;
OTHERWISE;
* Question Type is not known yet;
ENDCASE;
;
* adjust the list of responses based on the question type;
execute QUESTYPE with_parms(#S_190PQS #S_190PSN);
;
signal QuestionDetailsChgd;
endroutine;
*;
* Adds an entry to the list of possible responses ;
Subroutine AddResp parms(#S_190PSN #S_190PSA);
CHANGE #S_190PSL #S_190PSA;
ADD_ENTRY TO_LIST(#GRID_1);
endroutine;
*;
* The user has made a change to the list of responses, or other question details;
EVTROUTINE HANDLING(#GRID_1.ItemChanged #S_190PQA.Changed #MEMO_1.Changed #S_190PQSQ.Changed) OPTIONS(*NOCLEARMESSAGES *NOCLEARERRORS);
signal QuestionDetailsChgd;
ENDROUTINE;
*;
* The user has requested a breakdown of the responses to this question;
EVTROUTINE HANDLING(#MITM_QBRK.Click);
* Set the status bar into a busy state ;
Set #S_155RST uBusy(True);
;
CASE #S_190PQS;
WHEN '= RANK';
invoke #S_190FI.uShowQuesBreakdown mS_190PID(#S_190PID) mS_190PQN(#S_190PQN);
WHEN '= ANSWER';
invoke #S_190FJ.uShowQuesBreakdown mS_190PID(#S_190PID) mS_190PQN(#S_190PQN);
OTHERWISE;
invoke #S_190FF.uShowQuesBreakdown mS_190PID(#S_190PID) mS_190PQN(#S_190PQN);
ENDCASE;
;
* Set the status bar into a ready state ;
Set #S_155RST uBusy(FALSE);
ENDROUTINE;
*;
* The user wants to investigate whether there is a relationship between the responses for two questions;
EVTROUTINE HANDLING(#MITM_QREL.Click);
* Set the status bar into a busy state ;
Set #S_155RST uBusy(True);
;
invoke #S_190FG.uQuesRelationship mS_190PID(#S_190PID) mS_190PQN(#S_190PQN);
;
* Set the status bar into a ready state ;
Set #S_155RST uBusy(True);
ENDROUTINE;
* ;
* --------------------------------------------------------------------------------------------------------------------------------------;
* Poll Maintenance Actions --------------------------------------------------------------------------------------------;
* --------------------------------------------------------------------------------------------------------------------------------------;
*;
;
*New Poll ;
EVTROUTINE HANDLING(#PHBN_NEWP.Click #MITM_NEWP.Click);
CHANGE #S_ACTIONX NEW;
invoke #S_190FB.uShowPoll mS_190PID(#S_190PID) mS_ACTIONX(#S_ACTIONX);
ENDROUTINE;
*;
* Delete selected poll;
EVTROUTINE HANDLING(#PHBN_DELP.Click #MITM_DELP.Click);
CHANGE #S_ACTIONX DELETE;
invoke #S_190FB.uShowPoll mS_190PID(#S_190PID) mS_ACTIONX(#S_ACTIONX);
ENDROUTINE;
*;
* Close Poll;
EVTROUTINE HANDLING(#MITM_CLSP.Click);
CHANGE #S_ACTIONX CLOSE;
invoke #S_190FB.uShowPoll mS_190PID(#S_190PID) mS_ACTIONX(#S_ACTIONX);
ENDROUTINE;
*;
* Edit Poll;
EVTROUTINE HANDLING(#MITM_EDTP.Click);
CHANGE #S_ACTIONX EDIT;
invoke #S_190FB.uShowPoll mS_190PID(#S_190PID) mS_ACTIONX(#S_ACTIONX);
ENDROUTINE;
*;
* Open Poll;
EVTROUTINE HANDLING(#MITM_OPNP.Click);
CHANGE #S_ACTIONX OPEN;
invoke #S_190FB.uShowPoll mS_190PID(#S_190PID) mS_ACTIONX(#S_ACTIONX);
ENDROUTINE;
*;
* Run Poll;
EVTROUTINE HANDLING(#MITM_RUNP.Click);
* Build URL for this poll;
DEFINE #S_190PIDC *CHAR 15;
USE BUILTIN(NUMERIC_STRING) WITH_ARGS(#S_190PID) TO_GET(#S_190PIDC);
;
USE BUILTIN(TCONCAT) WITH_ARGS(*S_URLPORT *S_FIXEDURLPART 'SET_190+SET190A+' *PARTITION) TO_GET(#S_URLPORT);
;
USE BUILTIN(TCONCAT) WITH_ARGS(#S_URLPORT '+FUNCPARMS+STDRENTRY(A0010):P+S_190PID(P0150):' #S_190PIDC) TO_GET(#S_URLPORT);
;
USE BUILTIN(SYSTEM_COMMAND) WITH_ARGS(H #S_URLPORT) TO_GET(#STD_IDNO);
ENDROUTINE;
* ;
* --------------------------------------------------------------------------------------------------------------------------------------;
* General Purpose Routines --------------------------------------------------------------------------------------------;
* ---------------------------------------------------------------------------------------------------------------------------------------;
*;
;
*;
* Enable the buttons and group boxes according to the poll status and the action;
subroutine buttons parms(#S_190BTN);
DEFINE #S_190BTN *CHAR 20;
;
CASE #S_190PST;
WHEN '= DEFINE';
* Poll questions can be edited, poll can be edited run or opened, but not closed;
CASE #S_190BTN;
WHEN '= POLLSELECTED';
* poll selected;
set (#GPBX_QUESDET #GPBX_RESP #PHBN_DELP #MITM_DELP #PHBN_NEWP #MITM_NEWP #PHBN_NEWQ) Enabled(TRUE);
set (#MITM_OPNP #MITM_RUNP #MITM_EDTP) enabled(TRUE);
set (#MITM_CLSP ) enabled(FALSE);
WHEN '= QUESSELECTED';
* question selected;
set #PHBN_DELQ enabled(TRUE);
WHEN '= QUESEDIT';
* while editing a question or adding a new question no other changes can be made;
set (#PHBN_SAVE #PHBN_CANC) enabled(TRUE);
set (#GPBX_POLL #GPBX_QUESLST #PHBN_NEWP #PHBN_DELP #MITM_DELP #PHBN_NEWQ #MITM_NEWP #PHBN_DELQ) enabled(FALSE);
;
WHEN '= QUESSAVE';
* question saved, or changes cancelled;
set (#PHBN_SAVE #PHBN_CANC) enabled(FALSE);
set (#GPBX_POLL #GPBX_QUESLST #PHBN_NEWP #PHBN_DELP #MITM_DELP #PHBN_NEWQ #MITM_NEWP #PHBN_DELQ) enabled(TRUE);
WHEN '= NOQUES';
* there are no questions for this poll;
set (#PHBN_NEWQ ) enabled(TRUE);
set (#PHBN_DELQ) enabled(FALSE);
ENDCASE;
WHEN VALUE_IS('= CLOSED');
* Poll questions cannot be edited, poll cannot be run, but poll can be edited or re-opened or deleted;
CASE #S_190BTN;
WHEN '= POLLSELECTED';
set (#PHBN_NEWP #MITM_NEWP #PHBN_DELP #MITM_DELP) Enabled(TRUE);
set (#GPBX_QUESDET #GPBX_RESP #PHBN_NEWQ #PHBN_DELQ ) Enabled(FALSE);
;
set (#MITM_OPNP #MITM_EDTP) enabled(TRUE);
set (#MITM_CLSP #MITM_RUNP ) enabled(FALSE);
ENDCASE;
WHEN '= OPEN';
* Poll questions cannot be edited, poll can be edited, closed or run ;
CASE #S_190BTN;
WHEN '= POLLSELECTED';
set (#PHBN_NEWP #MITM_NEWP) Enabled(TRUE);
set (#GPBX_QUESDET #GPBX_RESP #PHBN_NEWQ #PHBN_DELQ #PHBN_DELP #MITM_DELP) Enabled(FALSE);
;
set (#MITM_CLSP #MITM_RUNP #MITM_EDTP) enabled(TRUE);
set (#MITM_OPNP ) enabled(FALSE);
ENDCASE;
ENDCASE;
endroutine;
*;
* Disconnect;
EVTROUTINE HANDLING( #Com_Owner.Closing);
invoke #VL_SAM003.uDisconnect;
;
* Disable all options until the user connects to the AS/400;
;
set (#PHBN_NEWP #MITM_NEWP #PHBN_DELP #MITM_DELP) Enabled(FALSE);
set (#GPBX_QUESDET #GPBX_RESP #PHBN_NEWQ #PHBN_DELQ ) Enabled(FALSE);
set (#MITM_OPNP #MITM_EDTP) enabled(FALSE);
set (#MITM_CLSP #MITM_RUNP ) enabled(FALSE);
;
ENDROUTINE;
* ;
* Information Message ;
SUBROUTINE INFMESSAGE((#EX_TEXT *RECEIVED));
define #ex_text *char 132;
message msgid(dcm9992) msgf(dc@m01) msgdta(#ex_text *blanks);
ENDROUTINE;
END_COM;
;