* Date Phrase plugin

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
LornaCraig
Megastar
Posts: 2989
Joined: 11 Jan 2005 17:36
Family Historian: V7
Location: Oxfordshire, UK

Date Phrase plugin

Post by LornaCraig » 31 Jul 2011 13:46

Running the Find Date Phrase plugin produces 'No Date Phrases Found'. But I know there are some. What am I doing wrong?

Lorna

ID:5319
Lorna

User avatar
PeterR
Megastar
Posts: 1129
Joined: 10 Jul 2006 16:55
Family Historian: V7
Location: Northumberland, UK

Date Phrase plugin

Post by PeterR » 31 Jul 2011 15:29

The first line in the for ... do ... end loop is:

Code: Select all

pi:MoveTo(pi,strTypeDesc)
According to the Help file example, this line should be:

Code: Select all

pi:MoveToFirstRecord(strTypeDesc)
If you use this line instead, the Plugin does return the correct result.  I think there may be another bug in that 'nill' is used instead of 'nil'.
Peter Richmond (researching Richmond, Bulman, Martin, Driscoll, Baxter, Hall, Dales, Tyrer)

User avatar
LornaCraig
Megastar
Posts: 2989
Joined: 11 Jan 2005 17:36
Family Historian: V7
Location: Oxfordshire, UK

Date Phrase plugin

Post by LornaCraig » 31 Jul 2011 17:37

Thanks Peter, that fixes it. I now have a long list of date phrases!

Lorna
Lorna

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

Date Phrase plugin

Post by Jane » 31 Jul 2011 20:07

Good Catch.

I'll fix the master copy when I get a moment.

Pre-Beta some of the functions got changed around and I think that's a hang over I missed.

edit: done
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

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

Date Phrase plugin

Post by Jane » 01 Aug 2011 08:11

Lorna,

Don't forget you can use a Plugin to fix the problems pretty easily, if you don't want to edit them manually, you just add them into the main loop

So for example if you have ABT. 1905 you can fix it using the code below.

Code: Select all

            -- Clean up date
            iYear = nil
            iYear = tonumber(string.match(strPhrase,'%d%d%d%d'))
            print(strPhrase,iYear)
            if iYear ~= nill then
               -- Got a Year
               if string.find(strPhrase,'ABT.') then
                  dpDatePoint:SetValue(iYear)
                  dtDate:SetSimpleDate(dpDatePoint,'approximate')
                  fhSetValueAsDate(pi,dtDate)
               end
            end
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

Post Reply