* Funny bug in Diagram text schemes?

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
avatar
wolfswald
Platinum
Posts: 30
Joined: 06 Jun 2011 11:14
Family Historian: V6.2
Location: Germany
Contact:

Funny bug in Diagram text schemes?

Post by wolfswald »

I discovered something funny in the Diagram text schemes. I am using V6.0.4 now.

Under certain circumstances, ONE letter of the place name is shown double. This seems to happen when there is no date for the event. It does not seem to depend on how long that place name is or how exactly it is structured. It seems to tend to be more or less in the middle of the term.

Examples:
München, D-98765 -> Münchenn, D-98765 (7th of 16)
Eichstätt, D-56788 -> Eichstättt, D-56788 (9th of 18)
Großkleckersdorf, D-12345 -> Großkleckerssdorf, D-12345 (12th of 25)
Hier, D-76544 -> Hier, D-76544 [double space after the comma] (6th of13)
Dort, Landkreis -> Dort, LLandkreis (7th of 15)
Diesisteinbesonderslangerortsname [one word] -> Diesisteinbesondderslangerortsname (16th of 33)
Diesisteinbesonderslangerortsname, D-45454 -> Diesisteinbesondersllangerortsname, D-45454 (20th of 42)

The text scheme looks like this:
bd. %INDI.BURI.DATE:COMPACT%\nin %INDI.BURI.PLAC:TIDY%

bug_textscheme.jpg
bug_textscheme.jpg (46.96 KiB) Viewed 7612 times
I would really like to get that fixed, it is kind of disturbing.

TIA
Sabine
avatar
wolfswald
Platinum
Posts: 30
Joined: 06 Jun 2011 11:14
Family Historian: V6.2
Location: Germany
Contact:

Re: Funny bug in Diagram text schemes?

Post by wolfswald »

... there does not seem to be a change if I change the place format from tidy to full or short - except that in the short format (PLAC:SHORT), the following happens:

Hier, D-76544 -> HHier (1st of 4)
User avatar
LornaCraig
Megastar
Posts: 3201
Joined: 11 Jan 2005 17:36
Family Historian: V7
Location: Oxfordshire, UK

Re: Funny bug in Diagram text schemes?

Post by LornaCraig »

You have a back-slash in the middle which seems to be causing the problem, although I don't know why it is having that odd effect.
Try
bd. %INDI.BURI.DATE:COMPACT% in %INDI.BURI.PLAC:TIDY%
Lorna
avatar
wolfswald
Platinum
Posts: 30
Joined: 06 Jun 2011 11:14
Family Historian: V6.2
Location: Germany
Contact:

Re: Funny bug in Diagram text schemes?

Post by wolfswald »

Actually, I have a backslash+n in the scheme: \n

I don't remember where I found that - have been using text schemes like this for years -, but it results in a forced line feed.

Without the \n, an entry might look like this:
b. 2 Apr 1765 in Kleinkleckersdorf, D-
12345 Großkleckersdorf

And I wanted it tidyer than that, decidedly putting the date in a separate line:
b. 2 Apr 1765
in Kleinkleckersdorf, D-12345 Großkleckersdorf

resp. (automatic line feed in the place):
b. 2 Apr 1765
in Kleinkleckersdorf,
D-12345 Großkleckersdorf

The double letter does appear, if we want to put it like this, long after the \n. You are right, though, that without the \n the problem does not appear. But them I am losing the formatting I want.

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

Re: Funny bug in Diagram text schemes?

Post by LornaCraig »

That's interesting, I haven't been able to find any reference to \n in the Help files for Text Schemes. The template is accepted as valid, but does have this odd effect if there is no date for the event.

Perhaps you could use separate lines in the Text scheme for date and place. For example
b.d. %INDI.BURI.DATE:COMPACT%
b.p. %INDI.BURI.PLAC:TIDY%
Lorna
User avatar
tatewise
Megastar
Posts: 28414
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Funny bug in Diagram text schemes?

Post by tatewise »

Yes, each Item in a Text Scheme defines a paragraph of text with a newline at the end.
So if you want newline breaks then create a separate Item for each line/paragraph.

To extract different comma separated parts of a Place field use the =TextPart(...) function.
e.g.
=TextPart(%INDI.BURI.PLAC%,1) gives 1st part
=TextPart(%INDI.BURI.PLAC%,2) gives 2nd part

BTW: \n is used in Plugin LUA scripts for newline (and my be used in other products), but that is a totally different feature from Text Schemes used in FH.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
wolfswald
Platinum
Posts: 30
Joined: 06 Jun 2011 11:14
Family Historian: V6.2
Location: Germany
Contact:

Re: Funny bug in Diagram text schemes?

Post by wolfswald »

Thank you for your suggestions, yet so far none really does what I want. So I started experimenting with functions, but I don't know where the error is.

I am thinking of something like this:
=TextIf(Exists(%INDI.CHR.DATE%), =CombineText("c. ", %INDI.CHR.DATE%\nin %INDI.CHR.PLAC:TIDY%),=CombineText("c. in ", %INDI.CHR.PLAC:TIDY%)

Computer says that the expression at Position 1 is not a valid function. I believe it means the part with CombineText, but I don't see it.

What I wanted to accomplish was using my old text scheme (with the \n) in case there is a date, and another one without the \n in case there is no date.

I also tried ExistsText, but that didn't work either.

Sabine
User avatar
PeterR
Megastar
Posts: 1135
Joined: 10 Jul 2006 16:55
Family Historian: V7
Location: Northumberland, UK

Re: Funny bug in Diagram text schemes?

Post by PeterR »

"=" is needed only at the start of the expression.
Peter Richmond (researching Richmond, Bulman, Martin, Driscoll, Baxter, Hall, Dales, Tyrer)
User avatar
tatewise
Megastar
Posts: 28414
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Funny bug in Diagram text schemes?

Post by tatewise »

Sabine, there is advice in how_to:understanding_expressions|> Understanding Expressions and how_to:understanding_data_references|> Understanding Data References and how_to:understanding_functions|> Understanding Functions.

Peter is correct that = is only needed before the outermost function.
The other thing wrong with your posted expression is a trailing ) is missing.
In other words, there are four ( but only three ) and should always be matched pairs.

I advise that you build up the Expression bit by bit.
Start with:
=TextIf( Exists(%INDI.CHR.DATE%), "Exists", "Missing" )
Then add nested functions one by one:
=TextIf( Exists(%INDI.CHR.DATE%), CombineText("c. ", %INDI.CHR.DATE%), "Missing" )

BUT as we said before you cannot use \n to start a newline.

So you need two Text Scheme Items, one called CHR Date and one called CHR Place.

CHR Date would have the Expression:
c. %INDI.CHR.DATE%
which automatically displays nothing if %INDI.CHR.DATE% does not exist.

CHR Place would have the Expression:
=NotExistsText(%INDI.CHR.DATE%,"c. ")=CombineText("in ", %INDI.CHR.PLAC:TIDY%)
which only displays c. if no %INDI.CHR.DATE% and only displays in if %INDI.CHR.PLAC:TIDY% exists.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
wolfswald
Platinum
Posts: 30
Joined: 06 Jun 2011 11:14
Family Historian: V6.2
Location: Germany
Contact:

Re: Funny bug in Diagram text schemes?

Post by wolfswald »

Mike,

you are right - and that was exactly what I tried, and failed just because of the = in the middle. However, before reading your post, I had come to a very similar solution:

First line:
b. %INDI.BIRT.DATE:COMPACT%
Second line:
=NotExistsText(%INDI.BIRT.DATE%,"b. ")in %INDI.BIRT.PLAC:TIDY%

But in your expression:
=NotExistsText(%INDI.CHR.DATE%),"c. ")=CombineText("in ", %INDI.CHR.PLAC:TIDY%)
we once again have a = in the middle?

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

Re: Funny bug in Diagram text schemes?

Post by tatewise »

I did make a small syntax error - there is a rogue ) extra - that I have now corrected.
However, the = in the middle is OK because it is NOT nested within another function.
The = before a function name is only removed when nested within ( brackets ) of another function.
So
=NotExistsText(%INDI.CHR.DATE%,"c. ")=CombineText("in ",%INDI.CHR.PLAC:TIDY%)
are two distinct functions one after the other
=NotExistsText(%INDI.CHR.DATE%,"c. ")
followed by
=CombineText("in ",%INDI.CHR.PLAC:TIDY%)

If we had used say
=NotExistsText( %INDI.CHR.DATE%, CombineText("c. in ",%INDI.CHR.PLAC:TIDY%) )
with CombineText(...) within the NotExistsText(...) brackets then there must be no = sign.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
wolfswald
Platinum
Posts: 30
Joined: 06 Jun 2011 11:14
Family Historian: V6.2
Location: Germany
Contact:

Re: Funny bug in Diagram text schemes?

Post by wolfswald »

Mike,

I am beginning to understand where to put the = and where not. (Maybe I already knew it in the past, but you establish those schemes and then use them for years without thinking about how they work ...)

In any case, the scheme did not yet do what I wanted, because the "b." etc. turned up unconditionally, thus using up lots of space without offering any information (except that there is none). But then I found that boolean operators are possible, too, and made it this:

First line, unchanged:
d. %INDI.DEAT.DATE:COMPACT%
Second line, now doubly conditional:
=TextIf(Exists(%INDI.DEAT.PLAC%) and Not(Exists(%INDI.DEAT.DATE%)),"d. ","")=TextIf(Exists(%INDI.DEAT.PLAC%),CombineText("in ",%INDI.DEAT.PLAC:TIDY%,,),"")

Thank you!

These extremely powerful text schemes are among the features I love most with FH.

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

Re: Funny bug in Diagram text schemes?

Post by tatewise »

Sabine, you do not need the second =TextIf(...) because =CombineText(...) is itself conditional on %INDI.DEAT.PLAC:TIDY% and will display nothing if that Data Ref does not exist.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply