Page 1 of 1

loadcase problem

Posted: June 14th, 2018, 3:12 pm
by tbernardo
Hi,

I'm having a problem with the loadcase function in a batch edit application. I'd like to fill in occupation codes based on occupation name but the loadcase is not working as expected.
Any clue about what am I doing wrong?

Regards,
Tomas

Re: loadcase problem

Posted: June 14th, 2018, 3:54 pm
by Gregory Martin
You need to specify the IDs when you're searching for a particular case:
if loadcase(OCUPACAO_DICT, OCUPACAO) then

Re: loadcase problem

Posted: June 15th, 2018, 1:06 am
by tbernardo
Hi Greg,

Even if I specifiy the IDs the loadcase doesn't work.
Regards,

Tomas

Re: loadcase problem

Posted: June 15th, 2018, 10:30 am
by Gregory Martin
The problem is that your lookup file is not a valid CSPro file. You are clearly constructing it with some other software, so here are three things to keep in mind:

1) The file should have the encoding UTF-8 with BOM. Your file is UTF-8 without BOM.

2) OCUPACAO_ID is not in the right position. In your dictionary, they are supposed to be at 108. Look at the screenshot below. You'll see that some are at 109, others 111, and so on. None are correctly at 108.
tber.png
tber.png (3.06 KiB) Viewed 4630 times
3) A CSPro file cannot contain tabs, which your file does (which you can see in the screenshot with the ->).

If you fix these problems, the code will work.

Re: loadcase problem

Posted: June 15th, 2018, 11:59 am
by tbernardo
Many thanks Greg. After changing the lookup file, as you advised me, it works perfectly.
Regards,

Tomas