* Header Record (1 FILE)

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
Ron Melby
Megastar
Posts: 917
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Header Record (1 FILE)

Post by Ron Melby »

it appears to me, that even when a file is used from outside family historian and brought into family historian (NOT AS A PROJECT) that the:

1 FILE C:\<file path>\stupendousgedcom.ged

is indeed the current file, and file path >>> ALL THE TIME within THIS.SESSION of family historian.

is this indeed correct with those of you more experienced or does anyone beg to differ?

It should be intuitively obvious, that I wish to run a plug-in from within family historian, but need some info, that FH does not provide.

say for example, UTF-8 or UTF-16 encoding.
FH V.6.2.7 Win 10 64 bit
User avatar
Valkrider
Megastar
Posts: 1563
Joined: 04 Jun 2012 19:03
Family Historian: V7
Location: Lincolnshire
Contact:

Re: Header Record (1 FILE)

Post by Valkrider »

Ron

I am sorry I don't understand your question and I suspect that I am not alone as you have received no other replies.
User avatar
Jane
Site Admin
Posts: 8507
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Header Record (1 FILE)

Post by Jane »

I am not sure what you are looking for, if you are simply trying in a plugin to find out what file you have open in Family Historian, you can use the fhGetContextInfo function.
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
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Header Record (1 FILE)

Post by tatewise »

Yes, the fhGetContextInfo("CI_GEDCOM_FILE") function will supply the full path and filename.

fhGetContextInfo("CI_APP_MODE") says whether in Project Mode or Gedcom Mode.

fhGetContextInfo("CI_STRING_ENCODING") says whether ANSI or UTF-8 is in use within FH, but not the GEDCOM file encoding.

Ron, why is your question phrased so negatively?
Why not simply ask how to obtain the information you need from within a Plugin, rather than imply it is not provided?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Ron Melby
Megastar
Posts: 917
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: Header Record (1 FILE)

Post by Ron Melby »

I speak the English language. I have not strongly suggested that it does not work or is not available, nor did I phrase it as a logical consequence. I was not in a position to do the FH version tree leaf, node, and nomenclature, therefore I used 1 FILE from the standard to describe it.

But enough of the non-extant implications of imply.

This is the logic.

1) open file either in project (where 1 FILE is (for lack of a better term) hardcoded or the alternative ways, such as, from open with....
2) immediately run a plug in. I can find the 1 FILE and the other, it is either ANSEL or UNICODE, isnt it?
3) the file autosaves every 5 minutes, lets say.

So the essential question, but I wasnt looking to write an opera, (but here I am doing so anyhow) was what sound does a tree make in the forest when it falls if no one is there to hear it? is the field valid before it is looked at (*immed update) and before the initial temp save?

If it is, then it is a trivial matter to read the first two bytes of the file and determine which UNICODE it is. I know how to obtain the information with a plug in, but do not know If the underlying code is such that it is not initialized until first look, or first save, and I can see and have seen lots of code like that in my life as a software programmer..........then its an issue, and needs to be gotten at another way.

The only conundrum that concerns us, is if this is the case, why does the property box have the option, header>hide if none ?

And before the cavil arises, FH default is UTF-16, but I use UTF-8 because of the many validators and sanity checks that will not accept UNICODE in the file even though to change the character set field to UTF-8 and save the file with a word processor and make no other changes keeps them working.

it ain't negative, nor positive, it ain't nothing actually, but a complex, valid question. And I was not wanting to wax long and poetic about it, but now we are here, what if there is no header, and under what circumstances could that occur? I am not implying negative here, I am plainly expressing one, here; now.
FH V.6.2.7 Win 10 64 bit
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Header Record (1 FILE)

Post by tatewise »

If you want to avoid using UNICODE (UTF-16) in the FH GEDCOM then tick the Tools > Preferences > File Load/Save > Save in UTF-8 file format option.

Then whenever FH V6 saves the GEDCOM file, either in a Project or stand-alone, it will always use UTF-8 character encoding, and always put 1 CHAR UTF-8 in the HEAD record, and use the UTF-8 Byte Order Mark (BOM) file prefix.

If in FH V6 you create a New Project from a GEDCOM file, then within the Project the internal GEDCOM file will immediately be either UNICODE (UTF-16) or UTF-8 depending on the Tools > Preferences > File Load/Save option above, but the original GEDCOM file will remain unaltered. The Plugin fhGetContextInfo(...) functions will refer to the internal Project GEDCOM file.

If you simply open a stand-alone GEDCOM file in FH V6 then I suspect its encoding will remain unaltered until the first Save or Auto-Save within FH, and then it will adopt the encoding as described above.

Within FH V6 the data defaults to UTF-8 encoding regardless of the original imported GEDCOM file encoding, which can be UNICODE (UTF-16), UTF-8, ANSI, ANSEL, or ASCII. The File > Export > GEDCOM File command offers all those formats.

BTW: Within FH V5 the data defaults to ANSI encoding regardless of the original imported GEDCOM file encoding.

It is NOT possible for a GEDCOM file to have no HEADer record, or are you asking about the Byte Order Mark (BOM) file prefix, which can be omitted in an imported or exported GEDCOM, but will always be present in a Saved file open within FH.

You ask "why does the property box have the option, header>hide if none ?.
I think you are talking about Tools > Preferences > Records Window > Record Type Display Options for Header.
I suspect that those drop-list options have been standardised for all record types, and that in practice the Hide if none is redundant in the case of Header records only.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Ron Melby
Megastar
Posts: 917
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: Header Record (1 FILE)

Post by Ron Melby »

Ok, look, guys...

I dont know how you go about things when you program, but I think of things and sort of come up with an outline, a plan and try to solve for the general case wherever possible.

Gedcoms (.ged) come in ANSEL, UTF-8, AND UTF-16, (there may be others but I so far unaware of them). I save in UTF-8 format, checked on the properties, and the BOM says UTF-8 and the header field says UNICODE. v v I am on 6.2.5 v v

I have said before I save mine in UTF-8 and I often set the header field to that instead of UNICODE with a word processor in order to have certain validators work correctly.

If I find my plug-in that I am considerning writing has some utility, THEN EACH AND EVERY ONE OF YOU WILL HAVE TO CHANGE YOUR FILES TO WORK WITH MY CODE. Nobody out there may have a ged encoded UTF-16. Everyone let me know when you are done.

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOrrrrrrrrrrrrrr.....................I could solve for the general case.

handle all three, by reading the first two bytes of the file and setting a switch.

Issue is where would I run into a gedcom without a header in FH? since the option is there, I assume it would be allowed, since mostly, nobody programs for nothing.
FH V.6.2.7 Win 10 64 bit
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Header Record (1 FILE)

Post by tatewise »

Ron, you have found errors in FH that should be reported to Calico Pie using the how_to:about#problem_reporting|> Problem Reporting method.

Remember that the people you are talking to in this Forum are just FH users like you. We do NOT write the FH program.

UNICODE ERROR
By default when FH saves its internal Project GEDCOM its uses UNICODE (UTF-16) character encoding, UTF-16 BOM, and puts 1 CHAR UNICODE in the HEAD record. (All my GEDCOM use this format.)
When Tools > Preferences > File Load/Save > Save in UTF-8 file format is chosen, FH saves its internal Project GEDCOM in UTF-8 character encoding, with UTF-8 BOM, but still has 1 CHAR UNICODE in the HEAD record instead of 1 CHAR UTF-8.
That is an error in the FH program, and should be reported to Calico Pie.

BTW: The File > Export > GEDCOM File command Format options for both Unicode and UTF-8 work correctly.

HEADER HIDE IF NONE ERROR
The Tools > Preferences > Records Window > Record Type Display Options for Header offer Hide if none.
That is an error, because it is impossible to have no HEAD record, and should be reported to Calico Pie.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
NickWalker
Megastar
Posts: 2597
Joined: 02 Jan 2004 17:39
Family Historian: V7
Location: Lancashire, UK
Contact:

Re: Header Record (1 FILE)

Post by NickWalker »

Ron Melby wrote: 1) open file either in project (where 1 FILE is (for lack of a better term) hardcoded or the alternative ways, such as, from open with....
2) immediately run a plug in. I can find the 1 FILE and the other, it is either ANSEL or UNICODE, isnt it?
3) the file autosaves every 5 minutes, lets say.
I haven't take the time to really study what you're asking or investigate the file formatting issues discussed (although I did do quite a lot of work on this a couple of years ago when I adapted Ancestral Sources to be able to use the various file formats). But in step 2 could your plugin first force a save of the project and then you could look at the format of the file itself immediately after that has completed?
Nick Walker
Ancestral Sources Developer

https://fhug.org.uk/kb/kb-article/ancestral-sources/
User avatar
Ron Melby
Megastar
Posts: 917
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: Header Record (1 FILE)

Post by Ron Melby »

Nick, et al.

I think that if I forced a save I would get an immediate complaint of file has changed do you want to reload? from FH. I do not think I could eat that error and continue because the window would remain unanswered in FH.

I would think that there appear to be some small unresolvable issues for the plug in at the moment, but I also think that the cases are going to be so trivial where it does happen, that ..... but, to cover all bases I will set up some tests and see what pukes, now that I have a better frame of reference here.

@Tatewise: I was unaware this was in error. I will report. That would obviate the issue altogether, or nearly.

BTW, except for maybe 10 trivial errors that simply require some rote typing and clicking that I haven't got to yet, my UDFs will be down to MDCL and PHON and I have not considered a way to resolve that yet, but like guys with tinfoil on their head, I know where they are, but 5.5.1 would be the brilliant solution, cuz I still havent figured out all the various ways that MAP LAT LONG is saved in the plugins and different programs I use, and I have EMAIL and WEB stuff that I would like to have ensconced and directly usable. Just about ready to start slamming media in this old girl. 2500 + names, and it is pretty clean, and pretty accurate. And you will be happy to know I use FH to do it about 90% of the time now.

@Nick Walker: I would like to have a little talk with you about something in Ancestral Sources. I will hit you up on YOUR website.
FH V.6.2.7 Win 10 64 bit
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Header Record (1 FILE)

Post by tatewise »

Ron, have you considered using the Export Gedcom File Plugin to produce GEDCOM files compatible with whatever products you are considering exporting to?

Not only does this Plugin get the 1 CHAR UNICODE/UTF-8 line correct, but also converts to Draft 5.5.1 where necessary, and takes into account all the various GEDCOM dialects in use by the most popular products.

When ready, start another thread regarding the UDF that you want to adjust, such as MDCL and EMAIL and PHON and WEB , and I can advise.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Ron Melby
Megastar
Posts: 917
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: Header Record (1 FILE)

Post by Ron Melby »

my only concern in the field UNICODE is for my personal use in a plugin. It is of no concern to me otherwise. I have already used a word processor to change the field to UTF-8 and when I use it in FH again it goes back to unicode. So, before I run a bunch of other validators on it, I have to remember to change it to UTF-8 or they puke. I have discussed the situation with the programmer of Oxy-Gen, and he has fixed it in his program, and he reads the BOM and proceeds accordingly. So he works no matter how I save it now. I am not able to contact most of the other vendors.

My current issue that requires use of a word processor is that I would like to move source records either singly or en masse from one event to another intra-record in the property window.

That is.. Oh, look the Cemetery book is under birth but not burial, it belongs under burial....ancillary evidence of birth aside, I want to move it to burial, I can do it longhand by clicking adding and deleting, but drag and drop would be so much easier and more efficient. 7 relatives give various dates of death for a person, and they are under birth, like to move them en masse, or by click list. it would be as handy as the current moving sources up and down and names up and down. When it is one it is an irritation, but when it is several it is downright pain.

Thing is, if I drop things out of FH to make them 5.5.1 then what do I even need FH for? It is obsolete at that point. Might as well buy a program that works with that standard. Doesn't matter if it is STANDARD STANDARD or not, it is widely embraced, bcause you can export 5.5, or 5.5.1. Many programs embrace 5.5.1. Mostly, those tags are, what to do with them other than _ATTR TYPE and have them sort correctly within my gedcom. it is funny, MDCL stays in place right behind CAUS but PHON which is attached to the last known address from the OBIT in RESI sorts down to <whole record> area. (I believe I went and changed all my MDCL to 2 but PHON was at 1 So, I have to go in a word processor and place them correctly and put them at two and they may stick near where they belong.
FH V.6.2.7 Win 10 64 bit
User avatar
Valkrider
Megastar
Posts: 1563
Joined: 04 Jun 2012 19:03
Family Historian: V7
Location: Lincolnshire
Contact:

Re: Header Record (1 FILE)

Post by Valkrider »

Ron

Rather than using a Wordprocessor as your editor consider using the free Notepad++ instead.

This has many editing functions that allow editing of records that meet criteria, those criteria can be simple or complex and can make use of Regex.

There is also a Gedcom plugin that enhances the base editor too, also free.
User avatar
Ron Melby
Megastar
Posts: 917
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: Header Record (1 FILE)

Post by Ron Melby »

I use it, rarely, it doesnt do much. I prefer Editpad Lite, If the Notepad++ plugin would indent as well as make the line it would be far more cute than it currently is.

And before we get there I know I can copy and paste, but I want cut and paste for citations. and a little handier than it is.
FH V.6.2.7 Win 10 64 bit
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Header Record (1 FILE)

Post by tatewise »

Have you tried fhugdownloads:contents:gedpad_editor|> Utility ~ GedPad Editor that does indent.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Ron Melby
Megastar
Posts: 917
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: Header Record (1 FILE)

Post by Ron Melby »

Yup thats not too bad, thats one of those that puke on UNICODE, it does something funky like: "error before 0 HEAD" cannot load file or file is not gedcom.............. change to UTF-8 and it works.

I use FT Analyzer, Genealogica Grafica, Gedcom Explorer, and several others, this is not an exhaustive list.
FH V.6.2.7 Win 10 64 bit
Post Reply