last digits skip pattern

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
Post Reply
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

last digits skip pattern

Post 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
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: last digits skip pattern

Post 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
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Re: last digits skip pattern

Post by MrTaco »

Thank Greg

It worked perfectly
Post Reply