* fhIsTAG or something akin is missing or is there a like alternative.

Writing and using plugins for Version 5 and above.
Post Reply
User avatar
Ron Melby
Megastar
Posts: 732
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

fhIsTAG or something akin is missing or is there a like alternative.

Post by Ron Melby » 06 Jun 2021 18:03

function matTAG(eptr)
local atr = fhIsAttribute(eptr)
local evt = fhIsEvent(eptr)
local fct = fhIsFact(eptr)

given an eptr to (for instance): 'NAME'
all of these fhIs* are false

and that would be fine because it could be considered it is one of the gedcom tags by default

However, I think a tag like NOTE2 has a different quality about it, since it is a programming conveinience tag. But it also reads the same as 'NAME' I can find no fhIs* or other way to differentiate these tags by class when I am reading an entire INDI or FAM record, is there something under some other name? or is it going to be a pair of lookup tables? ( I am unsure if I know all the programming tags (some special handling such as NOTE2' and 'PLAC' and what else).
FH V.6.2.7 Win 10 64 bit

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

Re: fhIsTAG or something akin is missing or is there a like alternative.

Post by tatewise » 07 Jun 2021 10:03

As you correctly say, the fhIsAttribute(), fhIsEvent() & fhIsFact() functions only return true for GEDCOM Fact tags, which relate to the Facts listed in the top pane of the Facts tab, e.g. BIRT, MARR, DEAT, etc.

You ask for a "way to differentiate these tags by class".
Well the FH API documentation offers fhGetDataClass(ptr) and does what you asked for.
So NAME has class name, PLAC has class place, and NOTE2 has class longtext (or possibly richtext in FH v7).
The other classes include age, link, date, integer, etc...
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Ron Melby
Megastar
Posts: 732
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: fhIsTAG or something akin is missing or is there a like alternative.

Post by Ron Melby » 07 Jun 2021 11:40

Ah thank you, did not find that one when I was trying to think of what the function name could possibly look like.

It starts with fh, so I got that part right, after that I didn't do so well.
FH V.6.2.7 Win 10 64 bit

Post Reply