* fhGetItemText is gone, & fhGetDisplayText chan

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
User avatar
SimonOrde
Program Designer
Posts: 352
Joined: 18 Nov 2002 10:20
Family Historian: V7
Location: Calico Pie

fhGetItemText is gone, & fhGetDisplayText chan

Post by SimonOrde » 02 Dec 2011 11:34

We've only just noticed that we have had two functions which do almost the same thing.  These were fhGetItemText and fhGetDisplayText.  The only difference between the two is that fhGetItemText took a data reference as a second parameter so you could have a line like this:

fhGetItemText(ind, '~.OCCU')

where up to now you haven't been able to do that with fhGetDisplayText.  It makes no sense to have two functions which are almost identical.  Also fhGetItemText isn't a brilliant name because it's not clear whether it's the value or a display text you're getting.  So we have decided to drop fhGetItemText altogether.  From 5.0.0.3 it won't exist any more.

fhGetDisplayText from 5.0.0.3 will take an optional 2nd parameter - a dataref.  So this is now fine:

fhGetDisplayText(ind, '~.OCCU')

Also - previously fhGetDisplayText just displayed the attribute value for an attribute.  From 5.0.0.3 it will give a better display version (in fact, it's pretty much exactly what you would see for the item in the 'All' tab of the Property Box, when its row is unexpanded.

If you need to access the value of a field as text, you should use fhGetValueAsText.

My apologies for any inconvenience caused by this change.  But a simple search replace (replace fhGetItemText with fhGetDisplayText) should quickly fix any plugins you have already written which use fhGetItemText.

ID:5607

User avatar
tatewise
Megastar
Posts: 27076
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

fhGetItemText is gone, & fhGetDisplayText chan

Post by tatewise » 17 Dec 2011 20:59

Unfortunately, a simple search/replace of fhGetItemText with fhGetDisplayText does not reliably fix any plugins that use it.
See V5 Beta Pending topic Plugin: fhGetDisplayText function for further fixes proposed for FH Beta V5.0.0.4
http://www.fhug.org.uk/cgi-bin/index.cg ... y&num=5255

Edit: fhGetItemText has been reinstated in 5.0.0.4 (see 22/12/11 posting in above thread).
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Post Reply