* fhOutputResultSetColumn

Homeless Posts from the old forum system
Locked
avatar
dickthomas
Silver
Posts: 9
Joined: 16 Nov 2002 13:23
Family Historian: None

fhOutputResultSetColumn

Post by dickthomas » 08 Jun 2012 14:26

This one is a bit complicated to explain. I have built a plug-in that is somewhat similar to the Kinsfolk census queries but it has additional tests and it gives answer of '*****' if census return is not expected, '( )' if it is expected but not there and the date if the census record is recorded. During the main part of the plug-in the information is written to a series of arrays with various count variables to keep track. Output via a series of fhOutputResultSetColumn commands takes each of the arrays in turn for its information. So far so good.

What I then wanted to do was to limit output to those individuals that still having missing census records (i.e. where for any one or more years output is '( )'. It seemed fairly simple - have a variable that records when there is a '( )' and then to write data to the arrays when it is set - otherwise pass onto the next individual.

It has sort of worked in that it produces an output table of the right number of lines for the number of individuals but about half the lines are blank whilst the other half give the right information.

The attaqched jpg shows the last bit of code. the variable icheck counts the number of times an '( )' appears for an individual. If icheck=0 then either we have all census records or there is none (e.e for years before birth, after death, etc.). kcheck counts the individuals where there are missing census records - and is therefore the expected length of the output table.

As I said the output table is of length kcheck but around half the records are completely blank.

Any ideas of what is going wrong would be gratefully received.

Kind regards,
DickImage

ID:6300

avatar
dickthomas
Silver
Posts: 9
Joined: 16 Nov 2002 13:23
Family Historian: None

fhOutputResultSetColumn

Post by dickthomas » 08 Jun 2012 14:38

To explain further - if you take out the 'if icheck==0' test and the next 2 lines and the relevant 'end'. The output gives a table showing the results for all individuals in the gedcom without any blank lines. That is obviously very useful but it would be better if it didn't report those records that are complete (i.e. where icheck =0.

Cheers,
Dick

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

fhOutputResultSetColumn

Post by tatewise » 08 Jun 2012 18:22

The main thing that catches my eye is that kcheck is counting Individuals, and thus output lines, but is NOT used to index the tables.
What is updating iCount ?
I would have expected each table to be indexed as [kcheck] not [iCount].

kcheck should start at 0, and place kcheck = kcheck+1 before loading the tables.
This ensures initial index is 1, and final value of kcheck is size of tables.

I suspect iCount is counting ALL Individuals and therefore many table entries have no data loaded.

avatar
dickthomas
Silver
Posts: 9
Joined: 16 Nov 2002 13:23
Family Historian: None

fhOutputResultSetColumn

Post by dickthomas » 08 Jun 2012 18:48

Thanks Mike,

That doesn't quite do the job but has given me some ideas. What is happening now is that I get the right number of lines in the output (and they are not blank) but it is overwriting some lines with other output that shouldn't be there.

As I said on the post about 'what plug-ins are for' it is great fun trying to get these plug-ins to do exactly what you want.

Cheers,
Dick

avatar
dickthomas
Silver
Posts: 9
Joined: 16 Nov 2002 13:23
Family Historian: None

fhOutputResultSetColumn

Post by dickthomas » 08 Jun 2012 19:02

Hi Mike,

Solved I think - using kcheck as index and then testing for icheck>0 as attached.

Thanks for your help - now need to tidy up the plug-in.

I have just over 3000 individuals and now the plug-in shows me that 1577 still have some census returns to complete. The plug-in also shows for each individual how many census returns are outstanding and it sorts the list starting with those who have 8 outstanding (a few).

Thanks again for your help.
Cheers,
Image

Locked