Page 1 of 1
Looping Index notation more widely supported
Posted: 30 Jan 2008 10:08
by GladToBeGrey
The 'Looping Index' notation should be supported by data references in ALL situations where a field/record can legitimately be repeated in the gedcom file.
For example, it is legitimate to have more than one NOTE attached to a DEAT, but %INDI.DEAT.NOTE2[1+] only picks up the first occurence (as does simply NOTE2), rather than looping through all occurences.
NOTE2[2] will explicitly pick up the second, NOTE2[3] the third etc etc. Oddly, NOTE2[1] always seems to be changed by FH back to be simply NOTE2. Why?
ID:2728
Looping Index notation more widely supported
Posted: 30 Jan 2008 12:39
by Jane
I can why you want this, can you confirm where you are looking for this? I suspect looping in Queries is covered by the Query by Event Item.
Does this not already work on diagrams? On reports I suspect looping is done automatically?
Looping Index notation more widely supported
Posted: 30 Jan 2008 14:25
by GladToBeGrey
I cant find any reference to 'Query by Event' anywhere? Not sure to what you refer?
I had a situation where I had a DEAT event with multiple local NOTEs. Using =GetLabelledText(%.....NOTE2%,['Label']) in an Individual query (there are no Event queries) to locate a given labelled text string only ever checked the first NOTE; if the item I wanted was in the 3rd (say), it was never returned unless I coded a seperate column for Note, Note[2], Note[3], note[4] etc.
The looping syntax would allow the text to be returned using a single column with a function like
=GetLabelledText(%INDI.DEAT.NOTE2[1+]%,['Label'])
regardless of how many NOTEs there were and which NOTE instance it was actually located in.
Looping Index notation more widely supported
Posted: 30 Jan 2008 16:09
by Jane
Looping Index notation more widely supported
Posted: 04 Feb 2008 13:27
by GladToBeGrey
Excellent; I've voted 5 for it! Perhaps that, mine and this -
http://www.fhug.org.uk/cgi-bin/index.cg ... y&num=2742 - should be combined.