Hi all,
In my plugin, I have the following code:
local strCit = fhGetValueAsText(fhGetItemPtr(ptrCitation, '~.AUTH'))
local strTitle = fhGetValueAsText(fhGetItemPtr(ptrCitation,'~.TITL'))
local strPubl = fhGetValueAsText(fhGetItemPtr(ptrCitation,'~.PUBL'))
local strPage = fhGetValueAsText(fhGetItemPtr(ptrCitation,'~.PAGE'))
All works as expected, except for the last line, which always returns an empty string, even though there is text in "Where Within Source."
Your help is appreciated.
Shoshana
* Problem getting value of "Where Within Source"
-
shoshk
- Famous
- Posts: 242
- Joined: 13 May 2015 16:28
- Family Historian: V7
- Location: Mitzpe Jericho, Israel
Problem getting value of "Where Within Source"
Shosh Kalson
-
shoshk
- Famous
- Posts: 242
- Joined: 13 May 2015 16:28
- Family Historian: V7
- Location: Mitzpe Jericho, Israel
Re: Problem getting value of "Where Within Source"
Hi again,
OK. So I figured it out and thought I'd post the solution in case it helps somebody else.
Those pesky greater-than signs...
I initialized ptrCitation as follows (I'm looping through citations, so I use a variable for the index):
local cit = 1
local ptrCitation = fhGetItemPtr(pFact, '~.SOUR[' .. cit .. ']>')
But, to get at "Where Within Source", as opposed to the Author, Title and Publication Facts, you don't use ">"
So I changed my code to:
local ptrPage = fhGetItemPtr(pFact, '~.SOUR[' .. cit .. '].PAGE')
local strPage = fhGetValueAsText(ptrPage)
And now it works.
Shoshana
OK. So I figured it out and thought I'd post the solution in case it helps somebody else.
Those pesky greater-than signs...
I initialized ptrCitation as follows (I'm looping through citations, so I use a variable for the index):
local cit = 1
local ptrCitation = fhGetItemPtr(pFact, '~.SOUR[' .. cit .. ']>')
But, to get at "Where Within Source", as opposed to the Author, Title and Publication Facts, you don't use ">"
So I changed my code to:
local ptrPage = fhGetItemPtr(pFact, '~.SOUR[' .. cit .. '].PAGE')
local strPage = fhGetValueAsText(ptrPage)
And now it works.
Shoshana
Shosh Kalson
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Problem getting value of "Where Within Source"
Just to clarify, the Citation & Source details are in different positions with different data refs.
Citations are attached to Facts in the Individual/Family Records, i.e. they appear in the Individual/Family Property Box and separated with a dot.
~.SOUR[1].DATA.DATE = 1st Citation Entry Date
~.SOUR[1].DATA.TEXT[1] = 1st Citation 1st Text From Source
~.SOUR[1].PAGE = 1st Citation Where within Source
~.SOUR[1].NOTE2[1] = 1st Citation 1st Note
Sources are separate Records and appear in a Source Property Box, which is why you need the > link indicator.
~.SOUR[1]>AUTH = 1st Source Record Author
~.SOUR[1]>TEXT =1st Source Record Text From Source
~.SOUR[1]>NOTE2[1] = 1st Source Record 1st Note
Citations are attached to Facts in the Individual/Family Records, i.e. they appear in the Individual/Family Property Box and separated with a dot.
~.SOUR[1].DATA.DATE = 1st Citation Entry Date
~.SOUR[1].DATA.TEXT[1] = 1st Citation 1st Text From Source
~.SOUR[1].PAGE = 1st Citation Where within Source
~.SOUR[1].NOTE2[1] = 1st Citation 1st Note
Sources are separate Records and appear in a Source Property Box, which is why you need the > link indicator.
~.SOUR[1]>AUTH = 1st Source Record Author
~.SOUR[1]>TEXT =1st Source Record Text From Source
~.SOUR[1]>NOTE2[1] = 1st Source Record 1st Note
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry