* Edit Text Scheme problem

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.
avatar
justone
Diamond
Posts: 82
Joined: 05 Mar 2006 14:42
Family Historian: None

Edit Text Scheme problem

Post by justone »

Again playing with some diagram display options since FH is best in working from within diagrams.

I want to archive the following:
Create line going like this:
'Birth:' left aligned
birthdate rightaligned with a given indent grouped w. prev.
birthplac leftaligned with a given indent grouped w. prev.

I tried with
'birth:' left aligned
^- %INDI.BIRT.DATE:ABBREV3% r.a. 20mm in.indent
^- %INDI.BIRT.PLAC:SHORT%   l.a. 23mm in.indent

but when I add similar lines for christening, marriage, death, burrial, the dates do jump or either don't get the right alignment settings.

I already tried using TABs instead, but that doesn't work either due to dates being either year only of full dates.

I also tried using monospaced fonts but since there's no date format in the form xx.xx.xxxx and single value days or months get stipped down to x.xx.xxxx or xx.x.xxxx I run out if ideas.

Perhaps someone got a hint what to try next


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

Edit Text Scheme problem

Post by tatewise »

I don't think the Alignment: Right option works for parts of a Line/Group.

The best I can think of is to subdivide the Date into day, Month & Year each with their own Indent:
e.g.
%INDI.BIRT.DATE:DAY%
%INDI.BIRT.DATE:MONTH_NUMBER%
%INDI.BIRT.DATE:YEAR%

It still is not perfect because single and two digit DAY and MONTH are all left aligned.
However, if you adjust the Indents appropriately they do fall into columns.

One further refinement that might work is to use the =TextIf() function to test if %INDI.BIRT.DATE:DAY% < 10 and output some space characters to prefix the date.
e.g.
=TextIf(%INDI.BIRT.DATE:DAY% < 10,'  ',)%INDI.BIRT.DATE:DAY%
avatar
justone
Diamond
Posts: 82
Joined: 05 Mar 2006 14:42
Family Historian: None

Edit Text Scheme problem

Post by justone »

The =TextIf solved the issue ... mostly.
I wanted a '0' instead of the ' ' but that gave me dates like this 0.0.1645 in case no day nor month being available. But your hint was a good one I could play with and see if functions offer to compensate the missing date formats I miss since FH 3.x

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

Edit Text Scheme problem

Post by tatewise »

This works:

=TextIf((%INDI.BIRT.DATE:DAY% > 0) and (%INDI.BIRT.DATE:DAY% < 10),'0',)%INDI.BIRT.DATE:DAY%

and similarly for :MONTH_NUMBER.

Another refinement to eliminate entries when there is no Event is to make the heading conditional.
e.g.
=ExistsText(%INDI.DEAT%,),'Died')

and similarly for BIRT ... 'Born' and for MARR ... 'Marr'.
avatar
justone
Diamond
Posts: 82
Joined: 05 Mar 2006 14:42
Family Historian: None

Edit Text Scheme problem

Post by justone »

Yep, I played with the =ExistsText already, and sine it looks I've found one really deep into this scripting, a question.

For ease of reading I used
Birth:
^- =TextIf(%INDI.BIRT.DATE:DAY% < 10,'0',)%INDI.BIRT.DATE:DAY%.
^- =TextIf(%INDI.BIRT.DATE:MONTH_NUMBER% <  10,'0',)%INDI.BIRT.DATE:MONTH_NUMBER%.
^- %INDI.BIRT.DATE:YEAR%
^- %INDI.BIRT.PLAC:SHORT%


where ^- means group with previous line and NOT start on new line

against having all these 5 line merged into a one-liner. But I suffer the side-effect that the 1 liner gives me
01.01.1999 against
01. 01. 1999 what the grouped version produces.

This is something I didn't get yet, since I assumed grouping things would simply add them one after the other.

From scratch (not tested yet) I must even use
=ExistsText(%INDI.BIRT.DATE:DAY%,=TextIf(%INDI.BIRT.DATE:DAY% < 10,'0',)%INDI.BIRT.DATE:DAY%.)
against using the 'AND' solution because of the trailing '.' <== dot.

Phew ... pretty late .. I think I'll have a try tomorrow morning.
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Edit Text Scheme problem

Post by tatewise »

Yes, Group Items are always separated by some space layout.
I thought that was the column layout you wanted, with each Group Item using a different Initial Indent.
Then every DAY number is in 1st column, MONTH_NUMBER in 2nd column, and YEAR in 3rd column.
This uses 0 mm, 7.5 mm, 12 mm, 16 mm & 24 mm respectively for each column Initial Indent.
Image

If you merge into one line then the numbers won't align when DAY or MONTH_NUMBER is missing.

You do NOT need =ExistsText() in Group Items to inhibit the trailing dot '.' when there is no number.
For an explanation, open an Edit Text Scheme Item window and click Help button.
Then in Template, click Understanding Text Templates and scroll down to 3. The Constant Text Rules.
Rule (b) explains why the 'constant text' trailing dot '.' will not be displayed.
avatar
justone
Diamond
Posts: 82
Joined: 05 Mar 2006 14:42
Family Historian: None

Edit Text Scheme problem

Post by justone »

Got it working somehow now, with 1 unsolved thing.
if a date returned isn't a numeral one, eg. something such as 'before September 1710' my solution only gives me a blank output, better said a 'Birth' followed by nothing.

I'm aware I must use a second declaration with 'only output if previous item blank' but I'm somewhat lost in how to do the check for the first declaration so that this remains blank in case the second declaration must be used.

I used
=ExistsText(%INDI.BIRT%,'Birth:')
with lots of grouped lines next giving date, place, ...
for the first one, to prevent an output in case no birth date given at all, but that doesn't cover terms like bef. est. app. and such like.

Apart from that issue, your suggestions were of great help, it nearly looks to what I wanted it. [wink]

All I could think of for the moment is to logical check if all these terms aren't present? like NOT 'app.' AND NOT 'est.' and so on? Or is there a way to say if date is texual then.....
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Edit Text Scheme problem

Post by tatewise »

The key to all those options is in the Help for General Topics > Date Formats.

You will see that the :DAY/:MONTH.../:YEAR qualifiers yield values for any simple Date or Interpreted Date Phrase.
They work fine for Approximate, Calculated and Estimated Qualifiers, which are simply disregarded.

For any Period Date, Range Date, Quarter Date, or Date Phrase you will need to use one of the :ABBREV... or :COMPACT qualifiers.
However, Date Phrase is only displayed with :COMPACT or :LONG.
Also these displays will upset your tidy tabulated columns.

To test what type of Date is involved there are a number of options:

(1) Test :YEAR
A test of (%...DATE:YEAR% > 0) will determine if it is a simple Date, or Interpreted Date Phrase.
e.g.
=TextIf(%INDI.BIRT.DATE:YEAR% > 0),'Born:',)
If true this ensures that the :DAY/:MONTH.../:YEAR qualifiers will yield appropriate values.

(2) Test :XDATETYPE
A test such as (%...DATE:XDATETYPE% = 'Between') will detect a Between Range Date or Quarter Date.
If you wish, this allows you to detect Approximate, Calculated and Estimated qualified Dates, etc, and display appropriate text.
The conditional expressions and display expressions can become quite long and complex.
avatar
justone
Diamond
Posts: 82
Joined: 05 Mar 2006 14:42
Family Historian: None

Edit Text Scheme problem

Post by justone »

I'm aware of all the Help topics but, since I'm not natively english speaking it's a bit tricky sometimes.
On the other hand, there's no real alternative to FH since half a decade, when it comes to flexibility of the program.

And sometimes I really run out of ideas why a defined script doesn't do what I wanted it to do.

Example:
if I use %INDI.FAMS[1+]>MARR.DATE:
I get all marriage events listed one after the other

if I use %INDI.BIRT[1+].DATE:
I get the first birth entry even if there's 2 of them declared
To get both of them
I need to do
%INDI.BIRT.DATE:
followed by
%INDI.BIRT[2].Date:
and get the both. Fully being aware one's not being born 2 times but perhaps differnt sources tell differnt dates.

Reading the help leaves some things unclear, which makes FHUG such a good thing in the end.

just had a quick look ag my actual template using a text editor. 1860 lines and growing [wink]
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Edit Text Scheme problem

Post by tatewise »

I have just tested:
Born: %INDI.BIRT[1+].DATE:COMPACT% in %INDI.BIRT[1+].PLAC:TIDY%
and
Marr: %INDI.FAMS[1+]>MARR.DATE:COMPACT% in %INDI.FAMS[1+]>MARR.PLAC:TIDY%
and both work as expected with multiple instances of Birth and Marriage.

However, they do NOT work if Group with previous line is used with separate template parts.
avatar
justone
Diamond
Posts: 82
Joined: 05 Mar 2006 14:42
Family Historian: None

Edit Text Scheme problem

Post by justone »

XDATATYPE was of some help, though I couldn't really make use of it for the first line, as suggested in you IM since
=TextIf(%INDI.BIRT[1].DATE:XDATETYPE% = 'Date','a real date','something fancy')
does work, but need multiple entries like that since one can't make use of multiple grouped lines with a function. But I used it some lines further down instead.

At the moment I do the following while still being unsure if that covers all possible dates.
First I must check if a birt.date is present I assume, since if yes, I must output the 'Birth:' which I do using
=TextIf(IsTrue(Exists(%INDI.BIRT[1+]%)),'Birth:',)
followed by a grouped line not being a new line with 13mm indent
=TextIf((%INDI.BIRT[1+].DATE:DAY% > 0) and (%INDI.BIRT[1+].DATE:DAY% 0,'.',)
followedby a grouped line not being a new line with 18mm indent
=TextIf((%INDI.BIRT[1+].DATE:MONTH_NUMBER% > 0) and (%INDI.BIRT[1+].DATE:MONTH_NUMBER% 0,'.',)
followed by a grouped line not being a new line with 23mm indent
%INDI.BIRT[1+].DATE:YEAR%
followed by a grouped line not being a new line with 31mm indent
%INDI.BIRT[1+].PLAC:SHORT%
and now I used the grouped but also the new line with 31mm indent
=TextIf(%INDI.BIRT[1+].DATE:XDATETYPE% = 'Date',,%INDI.BIRT[1+].DATE:XDATETYPE%)

the benefit I get is that the display is sort of aligned
dd.mm. yyyy place
      mm. yyyy place
               yyyy
                       place

aswell as getting a at it's best a 2-liner such as
      mm. yyyy place
                       (calculated)

Since %INDI.BIRT[1+].DATE% doesn't work ...BIRT... oder ...BIRT[1]... does the trick.
In return %INDI.FAMS[1+]>MARR.DATE% does work, even with =TextIF functions and loops through all marriages.

So do I really need to declare the on top mentioned 6-liner for BIRT[1], BIRT[2], ... to cover multiple birth dates, in case differnt sources do mention differnt dates?

And something I already did run into when scripts getting too complexed. One easily manages that some facts or events aren't displayed at all if the script doesn't catch them.
Means for example the above scripting fails when there's a date string such as 'bef Sep 1700' so I still have to think about covering these aswell, or add another bunch of grouped scripting which only get executed if previous item blank. This with the knowledgde that looping (e.g. [1+])through the events doesn't work, is quite tricky.

And as I assume tatewise will know the answer [smile]
Perhaps you could even find something in my scripting lines which I built too ugly and could be done lots easier to archive the same result. Comments most welcome.
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Edit Text Scheme problem

Post by tatewise »

Your first line:
=TextIf(IsTrue(Exists(%INDI.BIRT[1+]%)),'Birth:',)
can be simplified to:
=ExistsText(%INDI.BIRT[1+]%,'Birth:')
but the [1+] looping index does not work, so must repeat everything for [1] and [2] and [3].

To include all non-simple-Date formats change the last line to
=TextIf(%INDI.BIRT[1+].DATE:YEAR% > 0,TextIf(%INDI.BIRT[1+].DATE:XDATETYPE% = 'Date',,%INDI.BIRT[1+].DATE:XDATETYPE%),%INDI.BIRT[1+].DATE:COMPACT%)

Then your 2-liners will look like:
  dd. mm. yyyy place
                        Calculated
or
        mm. yyyy place
                        Estimated
or
                        place
                        Bef Mmm yyyy

This works because the outer function displays all non-simple-Date formats:
=TextIf( %INDI.BIRT[1+].DATE:YEAR% > 0, {simple Date case} , %INDI.BIRT[1+].DATE:COMPACT% )    e.g. displays   Bef Mmm yyyy   or   Frm yyyy To yyyy
and the inner function {simple Date case} is your original:
TextIf(%INDI.BIRT[1+].DATE:XDATETYPE% = 'Date',,%INDI.BIRT[1+].DATE:XDATETYPE%)       e.g. displays   Approx,  Calculated,  or  Estimated
avatar
justone
Diamond
Posts: 82
Joined: 05 Mar 2006 14:42
Family Historian: None

Edit Text Scheme problem

Post by justone »

Thanks ... looks as if you invented the scriptlanugage, seing the easy to manage to setup lines working as expected.

The non-simple-date formats gave the most problem. Better said they still do, since

=ExistsText(%INDI.BIRT[1+]%,'Birth:')
is a good replacement for my entry line, but it suffers the following problem.
When there's a date in the form 'bef Jul 1881' I get a
Birth:
Means, if I form the line being
Birth: . .
and a non-simple-date appears while no place is given, the line with 'Birth:' on it's own get's still printed.

To be on the safe side I think I must not only check if a birth event is available at all (which the line does) but also if XDATETYPE = 'Date', correct?
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Edit Text Scheme problem

Post by tatewise »

No, I do not think that will work correctly.
What is important is the Place field.
So we need to test if the ...PLAC data exists or not.

We need two similar Template lines to replace the last line.
The 1st line displays the extra Date details instead of the Place when it is missing.
The 2nd line displays the same Date details under the Place when it exists.

The 1st line has Group with previous line but NOT Start on New Line.
=NotExistsText( %INDI.BIRT[1+].PLAC%, TextIf(%INDI.BIRT[1+].DATE:YEAR% > 0,TextIf(%INDI.BIRT[1+].DATE:XDATETYPE% = 'Date',,%INDI.BIRT[1+].DATE:XDATETYPE%),%INDI.BIRT[1+].DATE:COMPACT%) )
This is original last line enclosed in =NotExistsText( %INDI.BIRT[1+].PLAC%, {original} )
So it replaces the Place on the same line.

The 2nd line has Group with previous line and Start on New Line like the original.
=ExistsText( %INDI.BIRT[1+].PLAC%, TextIf(%INDI.BIRT[1+].DATE:YEAR% > 0,TextIf(%INDI.BIRT[1+].DATE:XDATETYPE% = 'Date',,%INDI.BIRT[1+].DATE:XDATETYPE%),%INDI.BIRT[1+].DATE:COMPACT%) )
This is original last line enclosed in =ExistsText(%INDI.BIRT[1+].PLAC%, {original} )
So it is under the Place as originally, but only if the Place exists.
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Edit Text Scheme problem

Post by tatewise »

Another way is to always display any extra Date details in the Place position, and then display Place on the next line.

So the original Place Template becomes:
=TextIf( %INDI.BIRT[1].DATE:YEAR% > 0, TextIf( %INDI.BIRT[1].DATE:XDATETYPE% = 'Date', %INDI.BIRT[1].PLAC:TIDY%, %INDI.BIRT[1].DATE:XDATETYPE% ), %INDI.BIRT[1].DATE:COMPACT% )
Which displays the extra Date details, or if none then it displays the Place name.

The original last line Template becomes:
=TextIf( (%INDI.BIRT[1].DATE:YEAR% < 0) or Not(%INDI.BIRT[1].DATE:XDATETYPE% = 'Date'), %INDI.BIRT[1].PLAC:TIDY%,)
Which displays the Place name on next line, if extra Date details were displayed on first line.

Then your 2-liners will look like:
dd. mm. yyyy Calculated
place
or
mm. yyyy Estimated
place
or
Bef Mmm yyyy
place
and your 1-liners will look like:
dd. mm. yyyy place
or
mm. yyyy Estimated
or
Bef Mmm yyyy
avatar
justone
Diamond
Posts: 82
Joined: 05 Mar 2006 14:42
Family Historian: None

Edit Text Scheme problem

Post by justone »

Ups, that's now something causing a buffer overflow in my brain. [wink]

Perhaps you should take into accound that I need to translate thrownback terms such as 'Calculated, Estimated, Approx' into german in the end, asking for another bunch of =TextIf functions to be inserted, since I haven't found a way to get these translated, against havin managed to build a complete fact set using german terms, so apart from these terms I managed to get all output translated.

Checking against the PLAC is also something which might work for lines such as
Birth: . .
in case there's no standard date and no place given. But that's for BITH only. Because I also have lines like this:
Marr: . . @
or
Died: . . by

And yes I could use an AND logic to solve this.
I'll pick up your suggestions on a non-working day, eg. early in the morning when all my braincells are loaded, since playing with templates when not 100% concentration is given, things end up in a complete mess.
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Edit Text Scheme problem

Post by tatewise »

To translate to German replace:
%INDI.BIRT[1].DATE:XDATETYPE%
with
TextIf( %INDI.BIRT[1].DATE:XDATETYPE% = 'Calculated', 'Berechnet', TextIf(%INDI.BIRT[1].DATE:XDATETYPE% = 'Estimated', 'Geschätzten', 'Annähernd') )

Yes, extra logic should solve the other problem.
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Edit Text Scheme problem

Post by tatewise »

To obtain lines like this:

Code: Select all

Born: <dd>. <mm>. <yyyy> <place>

Born: <dd>. <mm>. <yyyy> <extra date>
                          <place>

Marr: <dd>. <mm>. <yyyy> <place> @ <atAge>

Marr: <dd>. <mm>. <yyyy> <extra date>
                          <place> @ <atAge>

Died: <dd>. <mm>. <yyyy> <place> by <cause>

Died: <dd>. <mm>. <yyyy> <extra date>
                          <place> by <cause>
for 1st line ending like ' by ' or '':

=TextIf( %INDI.DEAT[1].DATE:YEAR% > 0, TextIf( %INDI.DEAT[1].DATE:XDATETYPE% = 'Date', Text( %INDI.DEAT[1].PLAC:TIDY% . ExistsText( %INDI.DEAT[1].CAUS%, Text(' by ' . %INDI.DEAT[1].CAUS% ) ) ), TextIf( %INDI.DEAT.DATE[1]:XDATETYPE% = 'Calculated', 'Berechnet', TextIf(%INDI.DEAT[1].DATE:XDATETYPE% = 'Estimated', 'Geschätzten', 'Annähernd' ) ) ), %INDI.DEAT[1].DATE:COMPACT% )
i.e.
=TextIf( > 0, TextIf( = 'Date', by , ), )

and for 2nd optional line like ' by ':

=TextIf( %INDI.DEAT[1].DATE:XDATETYPE% = 'Date', , Text(%INDI.DEAT[1].PLAC:TIDY% . ExistsText( %INDI.DEAT[1].CAUS%, Text(' by ' . %INDI.DEAT[1].CAUS% ) ) ) )
i.e.
=TextIf( = 'Date', , by )

This simpler last line works if you do not use Interpreted Date Phrase such as 12 Jan 2013 ('at 10 pm') in any Diagram Events.
avatar
justone
Diamond
Posts: 82
Joined: 05 Mar 2006 14:42
Family Historian: None

Edit Text Scheme problem

Post by justone »

all I get is the error
'The function specifier at position 1 is too long and not valid'
Is there a setting within FH to expand it, or is there any other fault? I did a copy'n'paste from here to FH so any typos are next to impossible.
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Edit Text Scheme problem

Post by tatewise »

Sorry, I added some spaces to make the Template easier to read, which made it too long, so try:

=TextIf(%INDI.DEAT.DATE:YEAR% > 0,TextIf(%INDI.DEAT.DATE:XDATETYPE% = 'Date',Text(%INDI.DEAT.PLAC:TIDY% . ExistsText(%INDI.DEAT.CAUS%,Text(' by ' . %INDI.DEAT.CAUS%))),TextIf(%INDI.DEAT.DATE:XDATETYPE% = 'Calculated','Berechnet',TextIf(%INDI.DEAT.DATE:XDATETYPE% = 'Estimated','Geschtzten','Circa'))),%INDI.DEAT.DATE:COMPACT%)
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Edit Text Scheme problem

Post by tatewise »

I have found a way to display all Looping Index [1+] multi-instance entries.

This method relies on using the spare Event Descriptor field %INDI.BIRT[1+].TYPE%, etc.

Make sure the Template of 1st item of each Group is:

=ExistsText(%INDI.BIRT[1+]%,'Birth:')%INDI.BIRT[1+].TYPE%
or
=ExistsText(%INDI.CENS[1+]%,'Census:')%INDI.CENS[1+].TYPE%
or
=ExistsText(%INDI.FAMS[1+]>MARR%,'Marry:')%INDI.FAMS[1+]>MARR.TYPE%
etc.
Make sure all other Group items use the [1+] looping index everywhere.

Then in any Events with multi-instances set their Descriptor field as follows:
Open the Property Box and select the All tab.
Right-click on each instance of the Event and choose Add Descriptor.
Make sure one space character is entered into the field.

Image
avatar
justone
Diamond
Posts: 82
Joined: 05 Mar 2006 14:42
Family Historian: None

Edit Text Scheme problem

Post by justone »

Well, I modified your lines a bit, but I still don't get what I wanted. The problem seems to be that although the scripting is quite complexed, the essential commands are missing.
Like a textreplace and a leftstr and rightstr.

since I wanted

died: __.__.1710 sometown
died: 11.11.1710
died: __.__.____ sometown
died: __.__.____ by car accident
died: __.__.____ sometown by car accident

aswell as (2-liners I managed to get)
died: __.__.1710 sometown
                            calculated
died: 11.11.1710
                            calculated

but I want
died: __.__.1710 sometown
                            before

or at least
died: __.__.1710 sometown
                            bef 1710

against
died:                   sometown
                            bef 1710

In other works, if any day, month or year numerical info is present, no matter if extended by calc., est., approx., before, after, whatever, it should appear in the . . colums and then be added with a more precise addon in the second line.

I think without being able to trim down a 'bef ' string using a replace 'bef ' with '', it's sort of impossible.

So for the moment I think I better make no use of such information within the datafields themselves since being impossible to get an aligned output.

The idea using the descriptor for looping is quite interesting. Though one would easily miss to add that and then never ever see at there's data present which fails to be shown due to a correct template but a missing ' ' or desctiptor field.
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Edit Text Scheme problem

Post by tatewise »

Your conclusion is correct. The Template Codes are not that clever, so what you want is impossible.

Also, how would you deal with From 12 June 1908 to 14 December 1919 or Between 12 June 1908 and 14 December 1919?
Because these need two dates!

The Looping Index method is a workaround, and I agree it is not perfect.
I think the Looping Index problem is a bug, which I am reporting to Calico Pie.

I am also reporting the Picture Margins problem, and the problem that makes box wide.
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Edit Text Scheme problem

Post by tatewise »

I have thought about this over night and may have an answer.
It uses the Date Format Qualifiers :XDATE1 and :XDATE2 with the Functions =Day() and =Month() and =Year().

Name Template:    Displays Event Name i.e. Born, Married, Died, etc, with Descriptor workaround for [1+]
=ExistsText(%INDI.BIRT[1+]%,'Born:')%INDI.BIRT[1+].TYPE%

Day1 Template:    Displays Day Number of XDATE1 if exists, else XDATE2
=TextIf(NullDate(%INDI.BIRT[1+].DATE:XDATE1%),Text(TextIf((Day(%INDI.BIRT[1+].DATE:XDATE2%) > 0) and (Day(%INDI.BIRT[1+].DATE:XDATE2%) 0) and (Day(%INDI.BIRT[1+].DATE:XDATE1%) 0) and (Month(%INDI.BIRT[1+].DATE:XDATE2%) 0) and (Month(%INDI.BIRT[1+].DATE:XDATE1%) 0) and (Day(%INDI.BIRT[1+].DATE:XDATE2%) 0) and (Month(%INDI.BIRT[1+].DATE:XDATE2%) MARR, INDI.CENS[1+], INDI.DEAT[1+], etc.

The Place+Other1/2 Templates will be slightly different for each Event depending on what Other data is needed: 'by' Cause, or '@' Age, etc.

I have split up the Templates to make them easier to understand, and ensure they are not too long.

Example Diagram Box:
Image
avatar
justone
Diamond
Posts: 82
Joined: 05 Mar 2006 14:42
Family Historian: None

Edit Text Scheme problem

Post by justone »

Oh dear. I think I shouldn't have started this. Looks as if you spent a whole day getting that done, but respect, it looks quite good.
You should have added a 'bef 1911' aswell as a 'aft Jul 1920' line aswell in the pic, since that's the ones left unsolved.

1 day till weekend ... I'll take over this very interesting solution on saturday.

Which reminds me about the following. Is there any Editor with a syntax highlighting definition working with the scripting?

Have to modify the FH resources using a resouce editor anyway (did so with v3 and v4) to re-order some of the windows such as the indivials main tab so I can enter birt,chr,deat one after the other. Always reaching for the Detail tab is very ugly.

Reporting bugs, well, I think besides these issues it'll be much more of a help if in the Text Scheme Edit window the left side should be collapsable so that once one selected something from the left side, on got the full width of the window for working at the template line.
The other idea would be to auto-ignore return and space characters or tabs and make the template line itself a multiline fields, so that one could build tamplates similar to a program language with splitting up lines and indenting them for easier reading, like:
=IfText(something > 0,
   dothis
 ,
   dothat
)
I know it won't be that easy due to script items such as concatenating using ' . ', but at the moment it's somewhat ugly to work with lines of 350-400chars.
So your latest idea is usefull on it's own since not being such a mosterline which I always need to put into seperate ones to get it's sense.

And answering your qeustion 1 posting earlier. Lucky me, I totally avoid using From ... To or between date entries. I always try to keep things straight using either a full date or calc, est, app. if ever.

Despite all these things which could be improoved, the best thing on FH remains ... one can't do anything close to this with any other genealogy product as far as I know.
Post Reply