Page 1 of 1

FileRoot() in a Plugin

Posted: 07 Feb 2022 15:49
by quarlton
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?

Re: FileRoot() in a Plugin

Posted: 07 Feb 2022 16:10
by tatewise
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")

Re: FileRoot() in a Plugin

Posted: 07 Feb 2022 16:22
by quarlton
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