*CHAN.DATE CHAN.TIME

Writing and using plugins for Version 5 and above.
Ron Melby
Superstar
Posts: 261
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

CHAN.DATE CHAN.TIME

Postby Ron Melby » 11 Feb 2019 18:03

I cannot seem to read and write these with a plugin in the normal way. I see in the export gedcom, it is done with read file line instead of an interface with pointers. Is that the only way?
Win 7 64 bit. FH V.6.2.6

User avatar
tatewise
Megastar
Posts: 15629
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: CHAN.DATE CHAN.TIME

Postby tatewise » 11 Feb 2019 20:00

There are several reasons why the Export Gedcom File Plugin reads & writes GEDCOM files directly.
There are quite a few genuine FH tags such as CHAN that cannot be accessed via Plugins.
There are also plenty of custom tags needed by target products that cannot be created by Plugins as they are invalid in FH.

You will discover that the CHAN.DATE & CHAN.TIME data references are not satisfactorily support anywhere in FH.
I imagine the reason is the potential conflict between FH managing those Updated timestamps and users doing the same.

You can access the CHAN.DATE & CHAN.TIME data indirectly.
The LastUpdated(...) function allows the Date & Time to be read.
By creating & deleting a data item allows the current Date & Time to be written.

See my Set Missing Updated Timestamps Plugin for examples of what I'm talking about.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Ron Melby
Superstar
Posts: 261
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: CHAN.DATE CHAN.TIME

Postby Ron Melby » 11 Feb 2019 20:23

i actually saw that. I want to control the date and time. and 'now' isnt the date I am looking for....LOL
Win 7 64 bit. FH V.6.2.6

User avatar
tatewise
Megastar
Posts: 15629
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: CHAN.DATE CHAN.TIME

Postby tatewise » 11 Feb 2019 20:50

The only way to do that is to read & write the whole GEDCOM file directly.
Afterwards, FH will report the file has been changed and request to reload it, just as it does when AS changes it.
BUT reading and writing Unicode UTF-16 or UTF-8 encoded GEDCOM files is far from trivial.
If you really need to do so then you will need my encoder module embedded in the Export Gedcom File Plugin.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Ron Melby
Superstar
Posts: 261
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: CHAN.DATE CHAN.TIME

Postby Ron Melby » 12 Feb 2019 20:12

I was thinking that, except I dont understand it, so it is rather daunting.
Win 7 64 bit. FH V.6.2.6

User avatar
tatewise
Megastar
Posts: 15629
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: CHAN.DATE CHAN.TIME

Postby tatewise » 12 Feb 2019 20:47

Could you please explain why you wish to modify the Updated date-time stamps on records.
It appears at first sight to be an unusual thing to do. Maybe there is another way to achieve your objective.

If you are determined to go ahead, then you will have to accept my encoder module as it stands, without understanding how it works, and just use it as directed. The method of use is much the same as the standard ANSI file read method.
It also requires my general module and stringx module.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry


Return to “Plugin Discussions”

Who is online

Users browsing this forum: No registered users and 3 guests