count records in a roster in a data entry

Discussions about editing and cleaning data
Forum rules
New release: CSPro 8.0
Post Reply
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

count records in a roster in a data entry

Post by AriSilva »

I´m trying to use count to count records but it always returns 0.
It is in a proc after the form is executed.
I´ve tried with the dictionary name and the form name as below

numeric kk1 = count(E_VIAGENS_FORM where E01_FEZ = 1);
numeric kk2 = count(E_VIAGENS where E01_FEZ = 1);

but if I count them by hand it works
numeric kk3 = 0;
do i = 1 until i > totocc(e_viagens_form)
if e01_fez(i) = 1 then inc(kk3); endif;
enddo;
Best
Ari
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: count records in a roster in a data entry

Post by josh »

Count should work in that case. If send us a test app so we can reproduce we will look into it.
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

Re: count records in a roster in a data entry

Post by AriSilva »

Here is the test you asked for.
Attached the apc for testing the counts. It is a real application composed of a menu program and the interview program. I´m just sending the interview.
In order to see the problem I just create two cases.
Please, execute the program and click in the first case. I put a skip at the beginning for you to go direct to the E block. Advance thru all the fields (at E12 it will have na accept because I skipped the persons, it does not matter, just click on “Aceita”).
When you reach Z04 you´ll see the errmsgs with the counts. Both counts are 0 whereas the counting with do is 1

By the way, there is a commented delete at line 103 which is giving me a compiler error and I do not know why.
Attachments
90_Josh.rar
(456.46 KiB) Downloaded 309 times
Best
Ari
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: count records in a roster in a data entry

Post by josh »

This one is missing some dictionary files too.
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

Re: count records in a roster in a data entry

Post by AriSilva »

Sorry, I copied the files but did not change the fmf (and there was a missing dict too).
Here a fresh one.
Attachments
90_Josh_A.rar
(461.57 KiB) Downloaded 304 times
Best
Ari
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: count records in a roster in a data entry

Post by josh »

That does seem to be a bug with count. We will look into it. Fortunately you have a workaround by using the loop. Just stick with that for now.

The syntax error on line 103 is because you are trying to delete the form rather than the roster row. Try using

Code: Select all

delete(B_MORADORES000(i));
instead.
Post Reply