Accessing named lists via plugin
Posted: 05 Jul 2023 08:52
It's not clear to me how to access FH named lists via a plugin. I know they are stored in the header record, but the following code generates a listing of all header tags apart from _LIST (named list) and _ROOT (project root individual).
How do you access the _LIST tag (list name) and its sub-tag _IDS (list members)?
I also noticed that the tag sequence generated differs from that in the GEDCOM file, but I guess that's just a minor inconsistency in the way CP have coded it.
Code: Select all
pH = fhNewItemPtr()
p1 = fhNewItemPtr()
p2 = fhNewItemPtr()
pH:MoveToFirstRecord('HEAD')
p1:MoveToFirstChildItem(pH)
while p1:IsNotNull() do
print(fhGetTag(p1))
p2:MoveToFirstChildItem(p1)
while p2:IsNotNull() do
print(fhGetTag(p1), fhGetTag(p2))
p2:MoveNext()
end
p1:MoveNext()
end
I also noticed that the tag sequence generated differs from that in the GEDCOM file, but I guess that's just a minor inconsistency in the way CP have coded it.