Page 1 of 1

CHAN.DATE CHAN.TIME

Posted: 11 Feb 2019 18:03
by Ron Melby
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?

Re: CHAN.DATE CHAN.TIME

Posted: 11 Feb 2019 20:00
by tatewise
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.

Re: CHAN.DATE CHAN.TIME

Posted: 11 Feb 2019 20:23
by Ron Melby
i actually saw that. I want to control the date and time. and 'now' isnt the date I am looking for....LOL

Re: CHAN.DATE CHAN.TIME

Posted: 11 Feb 2019 20:50
by tatewise
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.

Re: CHAN.DATE CHAN.TIME

Posted: 12 Feb 2019 20:12
by Ron Melby
I was thinking that, except I dont understand it, so it is rather daunting.

Re: CHAN.DATE CHAN.TIME

Posted: 12 Feb 2019 20:47
by tatewise
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.