I have the following plugin I have created and want to add Burial Place Lat./Long. numeric column output - %INDI.BURI[1].PLAC>LATLONG:NUMERIC% and am not just sure how to do it.
@Title: Cemetery Summary Report
@Author: Gary Carson
@LastUpdated: April 2016
@Description:
Counts and Lists All Burial Places in the File
]]
tblCemeteries = {} -- Define array for Burial Places
pi = fhNewItemPtr() -- declare pointer
pi:MoveToFirstRecord("INDI") -- point to the first Individual record
while pi:IsNotNull() do
-- For each Person Add the Burial Place to the list
strCemetery = fhGetItemText(pi,'INDI.BURI[1].PLAC>')
tblCemeteries[strCemetery] = ( tblCemeteries[strCemetery] or 0 ) + 1
pi:MoveNext()
end
-- Build Tables for the result set columns for Burial Place and Qty
tbCemetery = {}
tblcount = {}
for strCemetery, iQty in pairs(tblCemeteries) do
table.insert( tbCemetery, strCemetery )
table.insert( tblcount, iQty )
end
fhOutputResultSetTitles("Cemetery Summary Report",
"Cemetery Summary Report")
fhOutputResultSetColumn('Burial Place', 'text',tbCemetery,#tbCemetery,260,'align_left',1,true)
fhOutputResultSetColumn('Count', 'integer',tblcount,#tbCemetery,30,'align_right',1,false)
* Cemetery Listing - Unique
- Gary Carson
- Famous
- Posts: 162
- Joined: 02 Mar 2016 17:46
- Family Historian: V7
- Location: Grand Island, Nebraska, USA
Cemetery Listing - Unique
Gary
Win 10, FH 7.0.15
Win 10, FH 7.0.15
- Jane
- Site Admin
- Posts: 8442
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Cemetery Listing - Unique
Personally I would get the record pointer for the Place record, rather than the text and use that in the first array and then in the second loop, simply get the Location information and add that to a new array.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
- Gary Carson
- Famous
- Posts: 162
- Joined: 02 Mar 2016 17:46
- Family Historian: V7
- Location: Grand Island, Nebraska, USA
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Cemetery Listing - Unique
I am not convinced that Jane's suggestion will work with the way you are counting Place name usage.
So the extra lines you need are:
tblLatLongNum = {} -- Define array for Lat/Longitude
strLatLongNum = fhGetItemText(pi,'INDI.BURI[1].PLAC>LATLONG:NUMERIC')
tblLatLongNum[strCemetery] = strLatLongNum
tbLatLong = {}
table.insert( tbLatLong, tblLatLongNum[strCemetery] )
fhOutputResultSetColumn('LatLong', 'text',tbLatLong,#tbCemetery,90,'align_right',1,false)
So the extra lines you need are:
tblLatLongNum = {} -- Define array for Lat/Longitude
strLatLongNum = fhGetItemText(pi,'INDI.BURI[1].PLAC>LATLONG:NUMERIC')
tblLatLongNum[strCemetery] = strLatLongNum
tbLatLong = {}
table.insert( tbLatLong, tblLatLongNum[strCemetery] )
fhOutputResultSetColumn('LatLong', 'text',tbLatLong,#tbCemetery,90,'align_right',1,false)
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- Gary Carson
- Famous
- Posts: 162
- Joined: 02 Mar 2016 17:46
- Family Historian: V7
- Location: Grand Island, Nebraska, USA
Re: Cemetery Listing - Unique
Mike,
That got the exact result I was looking for.
That got the exact result I was looking for.
Gary
Win 10, FH 7.0.15
Win 10, FH 7.0.15