Hi again - another API question...
I've had some fun trying to figure out how to extract long text fields, e.g. Notes or Text from Source, with all the html formatting in tact (or with known control char behaviour). These can either be rich text/embedded html or plain text with/without carriage returns.
Using fhGetItemText or fhGetDisplayText I seem to get cropped versions with all the paragraphs munged into a single unformatted text sentence.
This might be a LUA string handling artefact or the way the FH API returns the data in the way I've been using it.
Do you have to use the GetParagraph function ? What if a para is too long for the API ?
Can anyone provide a snippet of how it should be done please!
Thanks in anticipation!
Cheers
Paul
* Extracting long text fields, rich text, carriage returns etc
Extracting long text fields, rich text, carriage returns etc
Paul Weaver, London
- Jane
- Site Admin
- Posts: 8442
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Extracting long text fields, rich text, carriage returns etc
You need to create a Rich Text Object and pull the note into that.
See
https://www.family-historian.co.uk/help ... h_text.htm
and
https://www.family-historian.co.uk/help ... syntax.htm
in the plugin help.
See
https://www.family-historian.co.uk/help ... h_text.htm
and
https://www.family-historian.co.uk/help ... syntax.htm
in the plugin help.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
- tatewise
- Megastar
- Posts: 27087
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Extracting long text fields, rich text, carriage returns etc
Use the fhGetValueAsRichText(...) function to extract the Notes or Text from Source.
See https://www.family-historian.co.uk/help ... chtext.htm
See https://www.family-historian.co.uk/help ... chtext.htm
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Extracting long text fields, rich text, carriage returns etc
Thanks for the help. Will give it a go! 
Paul Weaver, London