* FileRoot() in a Plugin

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
avatar
quarlton
Famous
Posts: 150
Joined: 26 Feb 2004 13:07
Family Historian: V7
Location: Lincolnshire
Contact:

FileRoot() in a Plugin

Post by quarlton » 07 Feb 2022 15:49

I'm trying to use

strHowRelated =fhCallBuiltInFunction("Relationship", ptrInd1, ptrInd2, "TEXT")
as per the example in Plugin Help

But instead of ptrInd1 I would like to reference the FileRoot

I tried the obvious:

strHowRelated =fhCallBuiltInFunction("Relationship", FileRoot(), ptrInd2, "TEXT")


Unfortunately it wants a pointer to the File Root person, which is understandable.

I've searched the Plugin Help and this forum but can't find a way of getting a pointer for FileRoot.

Does anyone have any suggestions?
Dave Simpson ~ Boulton, Braham, Carney, Simpson and Jacobs

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

Re: FileRoot() in a Plugin

Post by tatewise » 07 Feb 2022 16:10

There is no plugin API for FileRoot, so I think you need to use the fhCallBuiltInFunction("FileRoot")
e.g.
strHowRelated = fhCallBuiltInFunction( "Relationship", fhCallBuiltInFunction("FileRoot"), ptrIndi, "TEXT")
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
quarlton
Famous
Posts: 150
Joined: 26 Feb 2004 13:07
Family Historian: V7
Location: Lincolnshire
Contact:

Re: FileRoot() in a Plugin

Post by quarlton » 07 Feb 2022 16:22

Thanks Mike,

I hadn't picked up that you could use FileRoot() as a function in its own right. The examples all tend to show as part of another function.

As usual your example worked a treat.

Cheers
Dave Simpson ~ Boulton, Braham, Carney, Simpson and Jacobs

Post Reply