FB II COMPILER
Define globals and compile options
Is there a method of checking my project's globals and making sure that I have not included any that are defined in the Runtime globals of PG:PRO?
I found one tonight that was inserted 3 years ago....mine was gWhen and Runtime's was gWhen&. I doubt that this is a very good mistake and I don't want to find others like it in another three years.
I placed the COMPILE 0,_noRedimVars at the beginning of my globals and pasted the Runtimes globals at the end of it and compiled the global file.....it did not show the mistake so I don't think this is a way to help.
Those are two different variables... gWhen is an integer, gWhen& a long int. There's no problem having both, unless you start XREFing arrays and such using them. Of course, there's a _confusion_ factor, since you might accidentally use the wrong one...
<< I placed the COMPILE 0,_noRedimVars at the beginning of my globals and pasted the Runtimes globals at the end of it and compiled the global file.....it did not show the mistake so I don't think this is a way to help. >>
It's caught every real problem I've managed to create, (along with _dimmedVarsOnly, of course) and I've managed to create a bunch over the years...
P.S. For those who still doubt the efficiency of _dimmedVarsOnly... I recently located a bug in a several-year-old commercial FB product where, similar to the case above, a variable was used as an & in one place and a % in another, but both should have been &. It wasn't a _crashing_ bug, but did result in wrong information being used in a minor spot!
COMPILE settings should be the same in all your files (INCLudes, MAIN, FLTR, TEST, HEADER...) try verifying and using _noRedimVars in all.
Of course, if you use the same name as a global but inside a CLEAR LOCAL MODE FN there is no danger as the use of MODE prevents it using globals.
However if it is defined as MODE and you _intended_ to use a global, you've got problems.
It would be a good think to do a compile all when checking this, to prevent FB from Not compiling files where there has been no change.
I find if i do something like this:
GLOBALS "project.glbl"
COMPILE 0,_thisProject
END GLOBALS
wherein my project.glbl file I put this:
_thisProject = _caseInsensitive _dimmedVarsOnly _noRedimVars _strResource
I don't have trouble keeping everything together...
|