subscript

Discussions about CSEntry
Post Reply
BELLE
Posts: 1
Joined: April 2nd, 2013, 9:10 am

subscript

Post by BELLE »

Hi

I have this kind of error AGE_MEMBER should have a subscript - you may get error messages when you run this application

i have multiple forms and my household member details such as age and sex is in form B ... then my next form is education and employment (form c) - and this is for person ages 6 and above if i will write a skip logic for the members education below 5 years , it returns an error above.

please help.


Thanks
Gregory Martin
Posts: 1796
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: subscript

Post by Gregory Martin »

If you have an item that occurs on a repeating record then you need to specify to which occurrence you want to refer.

Do you want to access the first person's age? In that case, write AGE_MEMBER(1).

If you want to access the fifth person's age, write AGE_MEMBER(5).

CSPro is warning you that it does not know which value of AGE_MEMBER you want to refer.
munespo
Posts: 1
Joined: January 25th, 2016, 6:52 am

Re: subscript

Post by munespo »

Hello Sir, am working on a large CAPI with many nested instances
1. i have the same error message: "WARNING: F7 should have a subscript - you may get error messages when you run this application"
the answer above says i should refer to which specific occurrence am referring to like F7(1)...
what if i want this skip to work on all occurrences

2. am having a multiple choice question F8_MR in this roster, with answer choices: F8_1, F8_2, F8_3... does these same logic codes correctly handle it:
LEN1 = length(strip($));
Y1 = "";
i = 1;
S1 = 0;

while i <= LEN1 do

if $[i:1] = "A" then
Y1 = concat(strip(y1), edit("99", 1));
F8_1 = 1;
elseif $[i:1] = "B" then
Y1 = concat(strip(y1), edit("99", 2));
F8_2 = 2;
elseif $[i:1] = "C" then
Y1 = concat(strip(y1), edit("99", 3));
F8_3 = 3;
elseif $[i:1] = "D" then
Y1 = concat(strip(y1), edit("99", 4));
F8_4 = 4;
elseif $[i:1] = "E" then
Y1 = concat(strip(y1), edit("99", 5));
F8_5 = 5;
elseif $[i:1] = "F" then
Y1 = concat(strip(y1), edit("99", 6));
F8_6 = 6;
elseif $[i:1] = "F" then
Y1 = concat(strip(y1), edit("99", 7));
F8_7 = 7;
elseif $[i:1] = "F" then
Y1 = concat(strip(y1), edit("99", 8));
F8_8 = 8;
elseif $[i:1] = "F" then
Y1 = concat(strip(y1), edit("99", 9));
F8_9 = 9;
elseif $[i:1] = "F" then
Y1 = concat(strip(y1), edit("99", 10));
F8_10 = 10;
elseif $[i:1] = "F" then
Y1 = concat(strip(y1), edit("99", 11));
F8_11 = 11;
elseif $[i:1] = "F" then
Y1 = concat(strip(y1), edit("99", 12));
F8_12 = 12;
elseif $[i:1] = "F" then
Y1 = concat(strip(y1), edit("99", 13));
F8_13 = 13;



endif;

i = i + 1;

enddo;
Gregory Martin
Posts: 1796
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: subscript

Post by Gregory Martin »

1) It's hard to tell how you can fix this without seeing your dictionary and application. There are a few instances in which CSPro gives an incorrect subscript warning, but they are generally correct. The way to handle the warning depends on which section of logic the code is. Post your code or application and we can look at it some more.

2) Your best option is to simply run your application to test the code. It looks like it might work, though you'll note that you keep using "F." Presumably you want to use "G"..."M."
Post Reply