The =TextPart() function fails when called via fhCallBuiltInFunction() in a Plugin.
e.g.
fhCallBuiltInFunction("TextPart","A,B,C",1,1,"STD")
gives the error message:
An error has occurred - plugin failed to complete
[string "C:\Users\Mike\AppData\Local\Temp\~fh9C67.tm..."]:1: fhCallBuiltInFunction - Parameter 5: unknown error
No changes have been made to data records.
Changing "STD" to "TIDY" or removing it makes no difference.
Secondly, parameter 2 must be a text string, and not a pointer to a text string.
The FH Help examples for =TextPart() use %INDI.BIRT.PLAC% which implies a data ref pointer should work.
e.g.
Anything like:
fhCallBuiltInFunction("TextPart",fhGetItemPtr(ptr,"~.ADDR"),1,1)
gives the error message:
An error has occurred - plugin failed to complete
[string "C:\Users\Mike\AppData\Local\Temp\~fhDC06.tm..."]:35: bad argument #2 to 'fhCallBuiltInFunction' (string expected, got userdata)
No changes have been made to data records.
* TextPart fails via Plugin
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
TextPart fails via Plugin
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- SimonOrde
- Program Designer
- Posts: 352
- Joined: 18 Nov 2002 10:20
- Family Historian: V7
- Location: Calico Pie
Re: TextPart fails via Plugin
Thanks for report this Mike. It turns out that all functions which have a parameter which is an enumerated value, introduced in version 6, also don't work with fhCallBuiltInFunction. We will fix this (for all of them) in the next upgrade (due out soon).
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: TextPart fails via Plugin
This is confirmed as fixed in FH V6.0.2 except that 2nd param must be a text string not a ptr.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry