Disappearing application…

I'm sure we have all seen this from time to time! We run our newly compiled program only to have it disappear all of a sudden for no apparent reason. We search and search and search... Finally we find, using whatever debugging methods we choose, that the program goes down when it assigns a value to a variable. Doesn't make any sense at all until we, hours later, realize that the darn variable is a REFERENCE variable! Yep, we accidentally hit the "Reference" checkbox on the column property window.

This looks all so simple and happy, doesn't it?

But there is a deadly problem lurking on that window that is so easy to overlook!

Do you see what it is?

No?

Look again!

The "Reference" checkbox!

In the past years I have probably lost more time to this than anything else and it is nobody's fault but my own!

It happens once in a while and that is the problem. If it happened every day I'd expect it, but it happens perhaps every 3 months or so.

I'm still not sure what I do to accidentally check it! The hot key for it is Alt-F and I'm very used to very quickly hit Alt-F-S to save. Years ago I found that key combination to be easier and more universal than Ctrl-S for Save so I stuck with Alt-F-S and I'm wondering if that's what I'm accidentally doing. Or maybe I accidentally click on it. Don't know.

Whatever the reason is, every so often I check the "Reference" checkbox and it's always when I'm implementing something new. So I, rather logically, assume that it is whatever new I'm adding, not that new variable I just added. After all, what in the world could go wrong when creating a simple variable? As it turns out, quite a lot can go wrong;)

So what happens when you try to assign the "July 31, 2009" date value to a reference variable? Chances are very good that the program is going to fall over in a dramatic way - no GPF, no nothing. It just disappears! It is unlikely that the value 76186 is pointing to anything useful!

It would be nice if a warning message was implemented in Clarion 7 as an option so that it would warn when the Reference checkbox was checked when creating or modifying a variable with something like: "Are you sure you want to create a Reference variable?" or "Are you sure you want to change "Loc:FromDate" into a Reference variable (&Loc:FromDate)?" It would save me some time and definitely some frustration when I accidentally check the "Reference checkbox"!

Happy bug hunting:)

Arnor Baldvinsson

Leave a Reply