Page 1 of 1

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

Posted: 08 Oct 2019 09:02
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

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

Posted: 08 Oct 2019 10:40
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 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.

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

Posted: 08 Oct 2019 10:56
by shoshk
Thank you so much. Problem solved!