Variable(s) length do not agree with dictionary ID length near line 25 in GLOBAL procedure

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
Post Reply
gbos
Posts: 51
Joined: June 18th, 2015, 7:49 pm

Variable(s) length do not agree with dictionary ID length near line 25 in GLOBAL procedure

Post by gbos »

Dear CSPRo Community,

Can anyone assist and find me a walk around the error when I compiled my program. For a brief, I was trying to develop a menu for my application.
The menu is supposed to allow enumerators do a household listing before the actual interview of the agricultural households. The error is found in the pff file after i finished editing it given below:

// Launch household questionnaire data entry application
function launchHouseholdDataEntry()
string pffFilename = pathname(Application) + "../LBPAS1718APS/Liberia_Pilot_Agricultural_Survey2017_18.pff";

if setfile(pffFile,pffFilename,create) = 0 then
errmsg("Failed to open file %s", pffFilename);
endif;

filewrite(pffFile,"[Run Information]");
filewrite(pffFile,"Version=CSPro 7.0");
filewrite(pffFile,"AppType=Entry");

filewrite(pffFile,"[DataEntryInit]");
// Use modify mode if the case already exists in the household
// data file, otherwise use add mode.
string mode;
open(LIBERIA_PILOT_AGRICULTUR_DICT);

if loadcase(LIBERIA_PILOT_AGRICULTUR_DICT, CHOOSE_HOUSEHOLD) = 1 then

mode = "modify";
else
mode = "add";
endif;

close(LIBERIA_PILOT_AGRICULTUR_DICT);
filewrite(pffFile,"StartMode=%s;%s",mode, CHOOSE_HOUSEHOLD);

filewrite(pffFile,"[Files]");
filewrite(pffFile,"Application=" + pathname(Application) + "../LBPAS1718APS/Liberia_Pilot_Agricultural_Survey2017_18.ent");
filewrite(pffFile,"InputData=" + pathname(Application) + "../Data/LBPAS1718.csdb");
{
filewrite(pffFile,"[ExternalFiles]");
filewrite(pffFile,"DISTRICTSPERPROVINCE_DICT=" + pathname(Application) + "../Household/Resources/DistrictsPerProvince.dat");
filewrite(pffFile,"DISTRICTS_DICT=" + pathname(Application) + "../Household/Resources/Districts.dat");
filewrite(pffFile,"ENUMERATIONAREAS_DICT=" + pathname(Application) + "../Household/Resources/EnumerationAreas.dat");
filewrite(pffFile,"HOUSEHOLDPOSSESSIONVALUE_DICT=" + pathname(Application) + "../Household/Resources/HouseholdPossessionValues.dat");
}
filewrite(pffFile,"[UserFiles]");
filewrite(pffFile,"TEMPFILE=%s","");

filewrite(pffFile,"[Parameters]");
filewrite(pffFile,"COUNTY=%s", CHOOSE_HOUSEHOLD[1:2]);
filewrite(pffFile,"DISTRICT=%s", CHOOSE_HOUSEHOLD[3:2]);
filewrite(pffFile,"CLAN=%s", CHOOSE_HOUSEHOLD[5:3]);
filewrite(pffFile,"EA=%s", CHOOSE_HOUSEHOLD[8:2]);
filewrite(pffFile,"AREA=%s", CHOOSE_HOUSEHOLD[10:1]);
filewrite(pffFile,"HH=%s", CHOOSE_HOUSEHOLD[11:2]);

close(pffFile);

execpff(pffFilename, stop);
end;

// Launch listing program
function launchHouseholdListing()
end;


Attached is the application:
LBPAS1718.zip
(181.04 KiB) Downloaded 274 times
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Variable(s) length do not agree with dictionary ID length near line 25 in GLOBAL procedure

Post by khurshid.arshad »

Please remove ", CHOOSE_HOUSEHOLD" this and then run.
best.
a.
gbos
Posts: 51
Joined: June 18th, 2015, 7:49 pm

Re: Variable(s) length do not agree with dictionary ID length near line 25 in GLOBAL procedure

Post by gbos »

Dear Khurshid Arshad,

Please find attached the error messages i got after the removing "Choose_household', The application compiled but wouldn't yield the targeted menu. In short, after the removal of Choose_household as you suggested the program compiled successfully but the menu malfunctioned. See the attachment below and try running the application. You will see what am talking about.

Regards,

Gbos
ERROR MESSAGES.docx
(204.28 KiB) Downloaded 276 times
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Variable(s) length do not agree with dictionary ID length near line 25 in GLOBAL procedure

Post by khurshid.arshad »

Please see attached folder. Now it is working.
best.
a.
Attachments
LBPAS1718.rar
(160.56 KiB) Downloaded 291 times
gbos
Posts: 51
Joined: June 18th, 2015, 7:49 pm

Re: Variable(s) length do not agree with dictionary ID length near line 25 in GLOBAL procedure

Post by gbos »

Many thanks, Khurshid Arshad. It is now working, I shall will continue working on it.


Regards,

Gbos
Post Reply