Decide not to display some rows in a roster

Discussions about CSEntry
Post Reply
Amoikon
Posts: 7
Joined: April 10th, 2020, 7:02 am

Decide not to display some rows in a roster

Post by Amoikon »

Hello everyone!
I have a roster in which I have predefined the elements in the first column, with elements from the previous question.
I would like to set a condition that allows me to display certain rows based on the elements checked in the question preceding the roster.
Can you please help me?


Bonjour tout le monde!
J'ai un tableau dans lequel j'ai prédéfini les éléments de la première colonne, avec des éléments de la question précédente.
J'aimerais mettre une condition qui me permet d'afficher certaines lignes en fonction des éléments cochés dans la question qui précède le roster.
Pouvez-vous m'aider svp?
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Decide not to display some rows in a roster

Post by josh »

Please provide a bit more detail on what you mean. Do you want to change the contents of the roster itself i.e. deleting the rows that don't meet the condition? Do you want to keep the contents of the roster but skip over rows so that as the user traverses the roster so that only enter data for certain rows?
Amoikon
Posts: 7
Joined: April 10th, 2020, 7:02 am

Re: Decide not to display some rows in a roster

Post by Amoikon »

I have a multiple choice question and then the roster.
At the roster level, each first column corresponds to each answer modality of the multiple choice question.
If an answer is not ticked, I want its line in the roster not to appear, and jump to the following row
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Decide not to display some rows in a roster

Post by josh »

In that case you can use "skip to next" in the preproc of the first column to skip over the row.
Amoikon
Posts: 7
Joined: April 10th, 2020, 7:02 am

Re: Decide not to display some rows in a roster

Post by Amoikon »

I tried but unfortunately it doesn't work. I don't know why.
I want to skip only to the next row if my condition is respected.
When I apply what you say, it skip to the next record record.

This is what I do :

PROC PRODUITS
preproc
$(1) = "Tomate";
$(2) = "Oignon";
$(3) = "Piment";
$(4) = "Aubergine";
$(5) = "Concombre";
$(6) = "Carotte";
$(7) = "Persil";
$(8) = "Haricot vert";
$(9) = "Laitue";
$(10) = "Poivron";
$(11) = "Chou";
$(12) = "Autre 1";
$(13) = "Autre 2";
$(14) = "Autre 3";

If pos("A", QUELS_SONT_VOS_PRODUITS_D_APPROVISIONNEMENT) = 0 then
skip to next;
endif;
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Decide not to display some rows in a roster

Post by josh »

Rather than use pos("A") you need to check pos of the letter that corresponds to the current row. For the first row pos("A), for the second row pos("B"), for the third row pos("C")... It would be easier if you used numbers - 1,2,3,4... instead of letters. Then you could simply do:

Code: Select all

string codeLigne = maketext("%d", curocc());
if ischecked(codeLigne, QUELS_SONT_VOS_PRODUITS_D_APPROVISIONNEMENT) = 0 then
   skip to next;
endif;
with letter codes (A, B, C...) you have to convert the row number to a letter. You can do that by creating a string with the letters of the alphabet and then use [] to get the letter at a given position:

Code: Select all

string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string codeLigne = alphabet[currocc():1];
Amoikon
Posts: 7
Joined: April 10th, 2020, 7:02 am

Re: Decide not to display some rows in a roster

Post by Amoikon »

Thanks Josh!
I try and get back to you.
Amoikon
Posts: 7
Joined: April 10th, 2020, 7:02 am

Re: Decide not to display some rows in a roster

Post by Amoikon »

It works perfectly!
Thanks Josh! ;) ;)
Post Reply