* Citations - can't figure out how to get 'Where within Source'

Writing and using plugins for Version 5 and above.
Post Reply
avatar
shoshk
Diamond
Posts: 94
Joined: 13 May 2015 16:28
Family Historian: V6.2
Location: Ashkelon, Israel

Citations - can't figure out how to get 'Where within Source'

Post by shoshk » 08 Oct 2019 09:02

I'm pulling out my hair here.

I have no problem diisplaying 'Where within Source' in a query.

But, apparently, I'm not using the correct reference in the plugin I'm writing.

My function gets a pointer to a fact - pfact, and loops through the citations (sources?) for the fact.

I'm having trouble accessing both 'Where within Source' and the citation 'Note'.

I've tried a number of alternatives; the current one is:

sPage = fhGetItemText(pfact, '~SOUR[1].PAGE') -- is always blank
sNote = fhGetItemText(pfact, '~SOUR[1].NOTE2') -- this gets the note for the Source record

Thanks for your help,
Shosh

User avatar
tatewise
Megastar
Posts: 16462
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Citations - can't figure out how to get 'Where within Source'

Post by tatewise » 08 Oct 2019 10:40

You have a missing dot after the tilda ~ in the relative data reference:
'~.SOUR[1].PAGE'
Perhaps you are thinking of the format for shortcuts.
( I don't understand why '~SOUR[1].NOTE2' works at all. )

See Knowledge Base > Understanding Data References > Relative Data References.
Also see the examples in the Tools > Plugins > How to Write Plugins help for fhGetItemText(...) and the very similar fhGetDisplayText(...) both of which use relative data references.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
shoshk
Diamond
Posts: 94
Joined: 13 May 2015 16:28
Family Historian: V6.2
Location: Ashkelon, Israel

Re: Citations - can't figure out how to get 'Where within Source'

Post by shoshk » 08 Oct 2019 10:56

Thank you so much. Problem solved!

Post Reply