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

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
User avatar
Ron Melby
Megastar
Posts: 917
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 »

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: 28341
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 »

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: 917
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 »

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