Here's another one.
Is it possible to make the output a link to the record? At the moment it is a bit of a pain finding the name and then having to go to the record separately.
Martin
ID:6448
* fhOutput
- Jane
- Site Admin
- Posts: 8441
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
fhOutput
Yes, just make sure you use an item type and pass in the pointer.
eg
eg
Code: Select all
tblRecord[count] = ptrIndividual:Clone()
fhOutputResultSetColumn('Record', 'item', tblRecord, #tblSurname, 140, 'align_left')
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."
- Jane
- Site Admin
- Posts: 8441
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
fhOutput
You are already building a table with the values in.
So you need to put a clone of a pointer in rather than the name of the person. Hence the first line.
Then when you add the column to the output you need to use 'Item' the second line.
If you look at the code for a plugin like 'Search All Possible Names' you can see a more detailed example.
Here is a quick loop
I have added a more detailed example to the wiki [wiki]plugins:code_snippets:result_set_creation[/wiki]
So you need to put a clone of a pointer in rather than the name of the person. Hence the first line.
Then when you add the column to the output you need to use 'Item' the second line.
If you look at the code for a plugin like 'Search All Possible Names' you can see a more detailed example.
Here is a quick loop
Code: Select all
local tblRecord = {}
pi = fhNewItemPtr() -- declare pointer
pi:MoveToFirstRecord('INDI') -- and set to the first record.
while pi:IsNotNull() do
table.insert(tblRecord,pi:Clone())
pi:MoveNext()
end
fhOutputResultSetColumn('Record', 'item', tblRecord, #tblRecord, 140, 'align_left')
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."
fhOutput
Thanks Jane, that's the explanation I needed. I'd been looking at your 'related media' code, but got bogged down in the numerous pointers and your use of 'fhGetValueAs Link' which didn't seem to do the same for me.
Still I'm sure I'll sort it out now. I've just managed tob output a simple table that works.
Martin
Still I'm sure I'll sort it out now. I've just managed tob output a simple table that works.
Martin