* help with Expressions for icons

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
johnmorrisoniom
Megastar
Posts: 882
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

help with Expressions for icons

Post by johnmorrisoniom » 30 Nov 2012 10:11

I am having problems with an expression to show if a multimedia object is attached to a marriage fact.

I have tried:

Code: Select all

=Exists(%FAM[1+].MARR.OBJE>%)
This works in the main, but not always if there are multiple marriages for each spouse.

I have also tried multiple expressions with a different icon for each expression:

Code: Select all

=Exists(%FAM[1].MARR.OBJE>%)
=Exists(%FAM[2].MARR.OBJE>%)
Again, this works, sort of, but the icons are only showing on one of the partners.

I know there will be an obvious answer, but help please

ID:6617

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

help with Expressions for icons

Post by Jane » 30 Nov 2012 10:36

Each Box has both a Family and Individual record associated. So you will probably need to work from the Individual one as FAM will be the Family Record associated with the box not the person in the box.

Something like

Code: Select all

=Exists(%INDI.FAMS[+1]>MARR.OBJE>%)
might work for you.

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

help with Expressions for icons

Post by tatewise » 30 Nov 2012 10:39

The [1+] looping index only works in Diagram Text Schemes not Box Conditions.

I am not sure why the [1] and [2] indexes don't work.

The following Expression does work:

Code: Select all

=IsTrue(Exists(%INDI.FAMS[1]>MARR.OBJE>%) or Exists(%INDI.FAMS[2]>MARR.OBJE>%))
and can be extended to [3]rd or [4]th spouse family.
Jane said: FAM will be the Family Record associated with the box
In the case of multiple (FAMS) partners, which Family Record is associated with each Box?

User avatar
johnmorrisoniom
Megastar
Posts: 882
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

help with Expressions for icons

Post by johnmorrisoniom » 30 Nov 2012 11:46

Thanks Mike and Jane,

I have used:

Code: Select all

=Exists(%INDI.FAMS[1]>MARR.OBJE>%)
and 
=Exists(%INDI.FAMS[2]>MARR.OBJE>%)
to give different icons for each marriage.

Thanks for your help.

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

help with Expressions for icons

Post by tatewise » 30 Nov 2012 12:26

In such simplified Condition Expressions you don't even need the =Exists() function, because %INDI.FAMS[1]>MARR.OBJE>% and %INDI.FAMS[2]>MARR.OBJE>% are each sufficient.

In case it was not obvious, the Priority of each Condition determines the order of the Icons on the Boxes.

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

help with Expressions for icons

Post by Jane » 30 Nov 2012 13:00

Mike said:
In the case of multiple (FAMS) partners, which Family Record is associated with each Box?
The Ancestor/Descendant box the Family is the family which links them to the tree, for spouse boxes it's the Family which links them to the Ancestor Descendant, this is why Family fields such as Marriage are normally shown on the Spouse box.

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

help with Expressions for icons

Post by tatewise » 30 Nov 2012 15:01

Jane, that works fine for Ancestor boxes where the Family that links them to the tree is the one & only FAMC parent/child Family.
It also works fine for all Descendant/Root boxes with only one FAMS spouse Family.

But Descendant/Root boxes with multiple FAMS spouse Families appear to be associated only with their last Spouse Family.
Thus these Descendant/Root boxes only display an Icon if the Marriage of the last Family meets the Conditions.
This explains why John found his Expressions work mostly, but not always for multiple marriages, bearing mind that the FAM[2] index is ignored.

A further complication is that the associated Family remains set in a Diagram, despite later Spouse Families being added to a Descendant/Root Individual, until a new Diagram is created.

Post Reply