ITER troubles.
Posted: 29 Jun 2019 06:15
I know you think this is old ground, sorry. I cannot figure out how to stop an unibounded (or perhaps you might think of them as set within limits) iterator. Never have worked with them on subtypes.
typical FAM record (stripped)
FAM = FAM ptr
HUSBAND = INDI ptr
WIFE = INDI ptr
CHIL = INDI ptr
CHIL = INDI ptr
ANOTHER FAM
here is the stripped code:
local ptr = fhNewItemPtr()
ptr:MoveToFirstRecord('FAM')
while ptr:IsNotNull() do
matFAM(ptr)
...
function matFAM(ptrFAM)
if ptrFAM:IsNotNull() then
...
ptrCHIL = fhGetItemPtr(ptrFAM, '~.CHIL>')
while ptrCHIL:IsNotNull() do
table.insert(tblFAM, fid)
matID(ptrCHIL)
matNAME(ptrCHIL)
matSEX(ptrCHIL)
matLifeInf(ptrCHIL)
matCEM(ptrCHIL)
ptrCHIL:MoveNext('SAME_TAG') -- NEXT Child in FAM
end
it is obvious that CHIL> is an iterator.
I need the ITEM and not LINK for matCEM and that is already a large complex function, I simplistically figure if its an ITEM it is an indi ptr if a link a sour ptr. (although the deciding just between link and item is no small deal.)
of course this will read all CHIL in any fam at present.how can I set limits to this.FAM? Husband and wife work well because they are not in a loop.
typical FAM record (stripped)
FAM = FAM ptr
HUSBAND = INDI ptr
WIFE = INDI ptr
CHIL = INDI ptr
CHIL = INDI ptr
ANOTHER FAM
here is the stripped code:
local ptr = fhNewItemPtr()
ptr:MoveToFirstRecord('FAM')
while ptr:IsNotNull() do
matFAM(ptr)
...
function matFAM(ptrFAM)
if ptrFAM:IsNotNull() then
...
ptrCHIL = fhGetItemPtr(ptrFAM, '~.CHIL>')
while ptrCHIL:IsNotNull() do
table.insert(tblFAM, fid)
matID(ptrCHIL)
matNAME(ptrCHIL)
matSEX(ptrCHIL)
matLifeInf(ptrCHIL)
matCEM(ptrCHIL)
ptrCHIL:MoveNext('SAME_TAG') -- NEXT Child in FAM
end
it is obvious that CHIL> is an iterator.
I need the ITEM and not LINK for matCEM and that is already a large complex function, I simplistically figure if its an ITEM it is an indi ptr if a link a sour ptr. (although the deciding just between link and item is no small deal.)
of course this will read all CHIL in any fam at present.how can I set limits to this.FAM? Husband and wife work well because they are not in a loop.