Login to participate
  
Register   Lost ID/password?

Louis Kessler’s Behold Blog

Exception-ally Bad - Sun, 20 Dec 2009

I’m almost completed all the bug fixes. There is one more that involves TRichView and scrolling up with the arrow key. When you reach that horizontal line in the Everything Report, it gives an exception.

There’s really only about 8 lines that are needed to get this working. I’ve just been trying hard to find those 8 lines, because they involve saving the selection and then restoring it. It’s easy in most of TRichView, but that horizontal line is a RichView Table, and I just haven’t been able to get that working. So I’ve got a question into Sergey on his Support Forums but I’ll have to wait until he gets back from holidays (Dec 27) before he can help me solve this.

Speaking of exceptions, a couple of people have complained about the exception handling that I added into the current beta. It causes problems interacting with their email system trying to set up an email to post back to me with the error.

That information has been tremendously beneficial to me. In about 4 bug reports, it led me directly to the source of the bug and saved me many hours of work. But I do admit that it is very intrusive and I don’t think I would like having a software product that tries to start my email program. So I’m going to work to simplify it considerably, and make it friendly and useful.

Basically, I’m going to have the box come up and just tell you the error that occurred (e.g. “Division by zero”) and the routine and line number where it thinks it happened. Then it will ask you to email that info to me to help me improve Behold.

I may decide to store that error in your Behold registry info, so that it can differentiate between the new errors and the ones that you’ve had before, and it can give you a count and ask you to email the info if it hasn’t happened before. When you upgrade to a new version, it will wipe out that registry info, because presumably those problems will have been fixed in Behold.

Then on my Future Plans page, I’ll list the errors, routines and lines where these exceptions have been reported. And I’ll mark them off as I get through them.

That’s what I’d call going from Exception-ally Bad to Exception-al.

The Name Game - Wed, 16 Dec 2009

A GEDCOM file contains a person’s name on the NAME tag. It normally looks like this:

1 NAME first middle /surname/ suffix

e.g. 1 NAME John Jacob Jingleheimer /Schmidt/ II

The name parts should be shown in the order given, but without the two slashes that surround the person’s surname.

To make this trickier, some East Indian names are in the form:

1 NAME /surname/ middle first

and should be displayed in that order.

I had Behold handling the East Indian names correctly, and I’ve now got it to handle the suffix automatically and correctly as well.

Behold is fairly unique in its ability to take the wife’s surname at birth and add the surnames of all the men she is matched to, ending with her final spouse, e.g. Mary Jane [Watson Osborn] Parker.

Now there are times you’ll want to override that. One example was a file that had under the marriage record a date of “NOT MARRIED”. So I check for that and do not add the husband’s surname in that case. I don’t know of any other instances where that sort of an indication is in the GEDCOM, but if I find any, I’ll add them. Once I get to Version 2.0 and editing, Behold itself will store this “override” into the file, so you’ll have complete control.

Some people have asked for the ability to turn off the generation of married names in Behold. While fixing the names, this turned out to be a very simple thing to do. So I’ve now added a Report option for this. Then Behold will give you less information than you’ll want just like other programs do.

Unexplainable Programming Occurrences - Mon, 14 Dec 2009

These are difficult bugs I’m being given. Fortunately, I am getting through them. I had hoped to have another beta out by now, but theres a few more fixes to do first.

I had a couple of those unexplainable programming occurrences happen. The worst was after I had done those two very difficult fixes, with the help of Uwe in the comments on my last blog post, and with the help of the LMD people on their newsgroup. I made those fixes and then was getting ready to go forward to the next item, and all of a sudden the files were loading much slower. I mean like 20 times slower.

It took me a while to trace this to where it was happening. First I tried using Eric Grange’s Sampling profiler that I was hoping to use in the future for optimization. I was terribly disappointed in how it couldn’t get me close to where the problem was. It was listing system routines with 90% of the time being string copies. Well I know that is going on at the low levels. What I want to know is from whence that is being called.

So I went back to AQTime. They just put out version 6.30 which finally includes integration into Delphi 2009, so it was worthwhile me trying it again. Of course, they’re still behind the times, because Delphi 2010 has been out for awhile so they’re over a year behind in their Delphi integration.

The AQTime Delphi 2009 integration didn’t help. Seemed to be buggy and I couldn’t get it to profile by line. So I did it externally and right away found the line in question. Problem was, there was absolutely nothing wrong with the line.

I was using Delphi PChars, and adding the length of the block to the starting character pointer to tell it where to stop. But somehow, it did not add correctly, and subtracted 4 instead. So the entire block was being Encoded once for each record, rather than once for each block. And the code was correct. I couldn’t find what was wrong.

I went back to my earlier beta version. It had no problem. I checked my next build. It was okay. Then the next build - that one no longer worked. There was nothing different codewise. I spent a day on it. Possibly some compiling option got changed, or some memory got filled somewhere? I don’t know. But my major changes had happened in the 5 builds since then. After I gave up trying to fix the problem, I had to go back to the working version and add all the changes since then and check step by step that the problem did not reoccur. It did several times along the way. So I had to go back and make fewer changes at a time. Doing so finally got me to my current state without the PChar problem.

So I’m totally perplexed and don’t know what this was. I have to stem my curiosity or I would spend the next two weeks or longer trying to track this down.

But the important thing is to continue on with the beta. So as long as I’ve rid myself of this problem that shouldn’t have occurred anyway, I better just forget about it, pretend it didn’t happen, and just cross my fingers that it doesn’t happen again. I don’t expect that it will, but if it does, then I’ll nail it down and put it away for good.

I guess I had entered the Programmer’s Twilight Zone. Let’s hope I’m out.