Page 1 of 1

Sentence template age attribute vs fact age

Posted: 27 Aug 2018 07:36
by dewilkinson
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?

Re: Sentence template age attribute vs fact age

Posted: 27 Aug 2018 08:24
by Jane
You could try something like

Code: Select all

{=TextIf(Exists(%FACT.AGE%),%FACT.AGE%,AgeAt(%CUR_PRIN%,%FACT.DATE%))}

Re: Sentence template age attribute vs fact age

Posted: 27 Aug 2018 09:50
by LornaCraig
FH has template codes to do this.
From the FH help files:

Re: Sentence template age attribute vs fact age

Posted: 27 Aug 2018 10:01
by tatewise
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.

Re: Sentence template age attribute vs fact age

Posted: 27 Aug 2018 12:00
by dewilkinson
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}. >