* fhOutput

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
MartinA
Gold
Posts: 22
Joined: 17 Aug 2012 09:00
Family Historian: None

fhOutput

Post by MartinA » 21 Aug 2012 12:04

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

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

fhOutput

Post by Jane » 21 Aug 2012 12:36

Yes, just make sure you use an item type and pass in the pointer.

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."

avatar
MartinA
Gold
Posts: 22
Joined: 17 Aug 2012 09:00
Family Historian: None

fhOutput

Post by MartinA » 21 Aug 2012 12:48

Thanks Jane. I'll play with that.

Martin

avatar
MartinA
Gold
Posts: 22
Joined: 17 Aug 2012 09:00
Family Historian: None

fhOutput

Post by MartinA » 21 Aug 2012 16:27

Sorry Jane, that proved a bit too abbreviated for me. Can you expand a bit further please?

Martin

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

fhOutput

Post by Jane » 21 Aug 2012 20:33

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

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')
I have added a more detailed example to the wiki [wiki]plugins:code_snippets:result_set_creation[/wiki]
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

avatar
MartinA
Gold
Posts: 22
Joined: 17 Aug 2012 09:00
Family Historian: None

fhOutput

Post by MartinA » 22 Aug 2012 09:08

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

Post Reply