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

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

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

Post by shoshk »

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
Shosh Kalson
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

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

Post by tatewise »

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 how_to:understanding_data_references#relative_data_references|> 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
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

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

Post by shoshk »

Thank you so much. Problem solved!
Shosh Kalson
Post Reply