loadcase

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
pelin
Posts: 15
Joined: January 6th, 2016, 5:30 am

loadcase

Post by pelin »

Hi, i have problem when using the loadcase comment. My problem is that i want another form to be opened for open-ended questions. The external form works well but when it comes to the loading stage, there is no data stored in the data file. Even when I type something in it, it becomes blank when i go back to that field. I would be glad if you could help me on this.

Here is my code:

alpha(60) wothresp; { Other answers response }
numeric wothcode; { Other answers code }

{ Function to ensure proper entry and updating of "Other" answers }
function getother( alpha(10) questnum, questocc );
{ Create alpha id for other answers file }
{ If your ID is not 7 characters in length, remember to fix the length of the level 1 ID and of OTHID in OTHERS.DCF }
OTHID = concat(edit("999",D), edit("999", F));
OTHQUES = questnum; { question number }
OTHOCC = questocc; { occurrence for multiple section/group or
multipart question }
{ Get the previous response back if already entered
in case of backtabbing or updating }

if !loadcase(OTHERS,OTHID,OTHQUES,OTHOCC) then
{ Otherwise initialize to blanks }
OTHRESP = " ";
OTHCODE = 0;
endif;
wothresp = OTHRESP;
wothcode = OTHCODE;
end;

PROC H01

postproc
{ Get Other Answer }
if $ = 4 then
getother( GetSymbol(), 0 );
enter FL_OTHERS
endif;
Attachments
CensusofPopHousing.zip
(7.14 KiB) Downloaded 268 times
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: loadcase

Post by Gregory Martin »

The function loadcase loads from an external file, but you will also need to update the file by using writecase. Try putting this at the bottom of your code:
PROC OTHSEC

    writecase(OTHERS);
It will save the "other" data to the file after it has been entered on the external form.
sah
Posts: 97
Joined: May 28th, 2015, 3:16 pm

Re: loadcase

Post by sah »

Kindly check the following sample from
CSPro\Examples 7.1\1 - Data Entry\Using External Files & Forms
pelin
Posts: 15
Joined: January 6th, 2016, 5:30 am

Re: loadcase

Post by pelin »

Oohhh you are right!!! I totally forget about the write case function :o Thank you very much :)
Post Reply