Page 1 of 1

Error message

Posted: January 29th, 2017, 8:19 pm
by Ricardo
Hi everybody. I am using this code from example and i have a problem with this error:

ERROR: Single variable - cannot have subscript (unexpected left parenthesis) near line 12 in DEPTO procedure

Best regards

Code: Select all

PROC GLOBAL
numeric i;
array aCodMuni(153);  //Códigos de municipio para el set de valores
array alpha(40) aNomMuni(153); //Nombres de municipio en el arreglo


PROC LBZIKA1_DIC_FF

PROC DEPTO
PREPROC
LF_DEP = DEPTO;
if loadcase(AREADIC_DICT, LF_DEP) = 0 then 
  errmsg("Departamento No existe, please reenter");
  MOVE DEPTO; 
endif;

do varying i = 1 until i > noccurs(AREADIC_DICT.AREADIC_REC)
 aCodMuni(i-1) = LF_MUNI(i); 
 aNomMuni(i-1) = LF_NMUNI(i);
enddo;

aCodMuni(i-1) = notappl;

setvalueset(MUNI, aCodMuni, aNomMuni);

Re: Error message

Posted: January 30th, 2017, 7:27 am
by josh
Please post the application. You can use the pack tool to create a zip file to upload.

Re: Error message

Posted: January 30th, 2017, 1:27 pm
by Ricardo
Thank you very much for your response, I attached the zip file

Re: Error message

Posted: January 30th, 2017, 2:43 pm
by josh
The application is missing the dictionaries. Please use the pack application tool. It will automatically include the dictionaries.

Re: Error message

Posted: January 30th, 2017, 5:30 pm
by Ricardo
Sorry, now I have included the dictionary

Re: Error message

Posted: January 30th, 2017, 6:24 pm
by josh
The problem is that AREADIC_REC is a singly occurring record. In the dictionary the MAX is set to 1. Change the MAX to maximum number of municipo you have in a departmento. Also, the item LF_MUNI should NOT an be an id-item in your dictionary. It should be part of the record. The only id-item in AREADIC should be LF_DEPTO.

Re: Error message

Posted: January 30th, 2017, 7:25 pm
by Ricardo
Thanks, I did what you told me and works perfectly, now you need to test it with CsEntry