Page 1 of 1

last digits skip pattern

Posted: February 15th, 2017, 4:31 am
by MrTaco
Good day Everyone

Please advice on how to implement the code

INTERVIEWER: LOOK AT LAST NUMBER OF THE QUESTIONNAIRE NUMBER ON THE FRONT PAGE (THE 4-DIGIT NUMBER, NOT THE BARCODED NUMBER).
7011240
7011243

LAST DIGIT OF QUESTIONNAIRE NUMBER = 0, 3, 6, 9 ASK Question 144

LAST DIGIT OF QUESTIONNAIRE NUMBER = 1, 4, 7 GO TO Question 146

LAST DIGIT OF QUESTIONNAIRE NUMBER = 2, 5, 8 GO TO Question 148

Re: last digits skip pattern

Posted: February 15th, 2017, 9:31 am
by Gregory Martin
To get the last digit you can do this:
numeric lastDigit = FIELD_NAME % 10;
And then:
if lastDigit in 0,3,6,9 then
    skip to QUESTION_144;

elseif lastDigit // ... so on

Re: last digits skip pattern

Posted: February 16th, 2017, 12:38 pm
by MrTaco
Thank Greg

It worked perfectly