TextPart fails via Plugin
Posted: 25 Jan 2015 17:51
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.
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.