* Strange behaviour of %INDI.~SPOUgt;NAME%

Homeless Posts from the old forum system
Locked
avatar
Rgemini
Gold
Posts: 12
Joined: 21 Apr 2005 11:51
Family Historian: None

Strange behaviour of %INDI.~SPOUgt;NAME%

Post by Rgemini » 30 Jul 2009 16:19

I have a query that includes spouse details via %INDI.~SPOU>NAME%

If %INDI% is a woman, the result is correct: her (first) husband's name. But if %INDI% is a man, the result is his own name.

Is this a bug, or am I missing something? I am using FH 4.0.2

ID:3901

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

Strange behaviour of %INDI.~SPOUgt;NAME%

Post by Jane » 30 Jul 2009 16:52

I am not seeing that problem on %INDI.~SPOU[1]>NAME[1]%

Image

Image

using the same 4.0.2 version. Can you send me the query to janetaubman at gmail.com so I can see if I can spot the problem.

avatar
davepacey
Famous
Posts: 135
Joined: 22 Nov 2002 19:00
Family Historian: V7
Location: Lincolnshire, UK

Strange behaviour of %INDI.~SPOUgt;NAME%

Post by davepacey » 30 Jul 2009 18:48

This would happen if you had selected %INDI.FAMS>~SPOU>NAME% rather than %INDI.~SPOU>NAME%

Regards,

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

Strange behaviour of %INDI.~SPOUgt;NAME%

Post by Jane » 30 Jul 2009 19:08

The query you sent is using the one David mentions if you use %INDI.~SPOU>NAME% it will work correctly.

I will highlight the FAMS version over the Calico, but for now use the simpler one. I suspect the other one returns
[1] Husband and [2] Wife, but I have not tried it.

avatar
Rgemini
Gold
Posts: 12
Joined: 21 Apr 2005 11:51
Family Historian: None

Strange behaviour of %INDI.~SPOUgt;NAME%

Post by Rgemini » 30 Jul 2009 21:03

Many thanks to both Jane and Dave for solving this one for me.  My brain hurts!

User avatar
SimonOrde
Program Designer
Posts: 352
Joined: 18 Nov 2002 10:20
Family Historian: V7
Location: Calico Pie

Strange behaviour of %INDI.~SPOUgt;NAME%

Post by SimonOrde » 31 Jul 2009 08:20

Jane is quite right. When we added support for same sex relationships, we needed a gender-neutral way of accessing the two spouses in a family record. So we extended the role of the ~SPOU shortcut so that it could be used not just with individuals, but also with families. To quote from the Help:

'When used in the context of a Family record, the Spouse shortcut, with index 1, will return the first spouse of either sex, and, with index 2, will return the second spouse of either sex.' (this is in the section on 'Shortcuts' in the page 'Understanding Data References').

Locked