* Sentence template age attribute vs fact age

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
User avatar
dewilkinson
Superstar
Posts: 280
Joined: 04 Nov 2016 19:05
Family Historian: V7
Location: Oundle, Northamptonshire, England
Contact:

Sentence template age attribute vs fact age

Post by dewilkinson » 27 Aug 2018 07:36

I have tried without success to locate how to include in a Fact sentence template use the age attribute if present else use the calculated age i.e. use {age} if not present use {%FACT.AGE%}. Is such an IF / OR possible in a sentence template?
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia

Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Sentence template age attribute vs fact age

Post by Jane » 27 Aug 2018 08:24

You could try something like

Code: Select all

{=TextIf(Exists(%FACT.AGE%),%FACT.AGE%,AgeAt(%CUR_PRIN%,%FACT.DATE%))}
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
LornaCraig
Megastar
Posts: 2996
Joined: 11 Jan 2005 17:36
Family Historian: V7
Location: Oxfordshire, UK

Re: Sentence template age attribute vs fact age

Post by LornaCraig » 27 Aug 2018 09:50

FH has template codes to do this.
From the FH help files:
Attachments
age codes.JPG
age codes.JPG (80.49 KiB) Viewed 3390 times
Lorna

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

Re: Sentence template age attribute vs fact age

Post by tatewise » 27 Aug 2018 10:01

Or:
{=CombineText( ,%FACT.AGE%, , AgeAt(%CUR_PRIN%,%FACT.DATE%) )}
but for Family facts (Marriage, Divorce, etc) it gets more complex and I have not worked it out yet.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
dewilkinson
Superstar
Posts: 280
Joined: 04 Nov 2016 19:05
Family Historian: V7
Location: Oundle, Northamptonshire, England
Contact:

Re: Sentence template age attribute vs fact age

Post by dewilkinson » 27 Aug 2018 12:00

Lorna, Mike,

Many thanks, both work but I have gone with the CombineText version. I primarily wanted this for death records as many ancient burial records didn't record an age.

My death sentence now reads

Code: Select all

<para>{%CUR_PRIN.NAME[1]:FIRST%} died< of {cause}>< on {%FACT.DATE:DAY_OF_WEEK%}>< {date}>< at {_place}>< aged {=CombineText( ,%FACT.AGE%, , AgeAt(%CUR_PRIN%,%FACT.DATE%) )}><, {note}>. <This death was witnessed by {role=witness}. >
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia

Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them

Post Reply