Re: =TextIf function not working properly?


Mike Tate
 

Hi Graham,

Your Sentence Template expression is working perfectly for me.

I suspect to test it you are deleting the contents of the Address box.

But that does not delete the Address field and just leaves it blank until you close & open FH.

So that blank Address is what is being shown in the Sentence.

To completely delete the Address use the All tab and delete the Address field name on the left.

 

Why are you using {%CUR_PRIN.NAME[1]:FULL%} when using {individual} usually works just as well?

 

One minor problem is that the prefix ‘at’ does not usually read well with a Place name that reads better with ‘in’.

 

In this case the following works better that using <at {=TextIf(…)} >

{=CombineText("at ",TextPart(%FACT.ADDR%,1,5,Tidy),,Text("in " .TextPart(%FACT.PLAC%,1,5, Tidy)))}

 

Regards, Mike Tate

 

From: family-historian@groups.io <family-historian@groups.io> On Behalf Of Graham Conner via Groups.Io
Sent: 11 February 2020 15:37
To: family-historian@groups.io
Subject: [family-historian] =TextIf function not working properly?

 

Hi,

I have been using Family Historian for some time and been using my own Sentence Templates without problems. As I use both Place and Address data with the administrative location in the Place and postal address in the Address field, I wanted to be able to display or print out the address if it has been entered and if not display or print the place.  This is what I am trying to use in the Sentence Template for the Birth as an example.

 

<para>{%CUR_PRIN.NAME[1]:FULL%} was born {date} <at {=TextIf(Exists(%FACT.ADDR%),TextPart(%FACT.ADDR%,1,5,Tidy),TextPart(%FACT.PLAC%,1,5, Tidy))} > <({age})>

 

The TextIf seems to be broken, or I am not using it correctly and I am not sure which.  The above results in the Address being displayed if it has been entered, which is correct,  but if there is no Address, then it does not print out the Place. I end up with just the Name and Date of Birth and then nothing else.

 

I have tried cut and pasting examples from the Help screens to see if something simple would work, but these do not work either.

 

I have Family Historian 6.2.7 installed on a PC running Windows 10 and all the latest updates. I have tried reinstalling FH, and tested it on another PC. I get the same results.

 

Best Regards,

Graham

 

Join family-historian@groups.io to automatically receive all group messages.