Arnaud and Kirk, thanks for your answers.

This:
> I began using "all variables are typed" several years ago and the overall
> quality of my databases (though not necessarily individual methods)
> improved greatly.

and this 
> And it can be (I stress 'can be') convenient to make Compiler_ methods for
> specific modules or areas of the database, eg. Compiler_scheduling,
> Compiler_vendors, Complier_web. 

... is that we do since years and it helped and are helping still to get a good 
code quality. But therefore I'm a bit surprised that we are not able to detect 
such a simple array dimensions problem before runtime. And this error message 
isn't very specific: "Argument types are incompatible." Yes, it isn't wrong, 
but ...
The error is easily detectable as you can see if you switch the compiler 
settings. Maybe we have to adapt our guidelines for creating new builds of our 
software: Do at least two compiler passes manually, one with setting "all 
variables are typed" and one with "type the variables". Hmmm ...

@Arnaud: Nice method you provide. Especially as you already said for resizing 
of arrays. I like assertions, it really helps to avoid errors made by the 
developers.
But in our case it was not a "real" resize of that array. The declaration in 
the Compiler_ method was done to fulfill the requirements for compiling in mode 
"all variables are typed". The second call in code is an one-time 
initialization of the array, it serves as a constant array and is not changed 
again. Now I'm thinking about strategies to avoid the reported problem. 
One could be the following:
Since we use this kind of arrays as constant arrays it could be possible to put 
the declaration and the initialization in one place and not in two different 
methods. And because we use the compiler setting "all variables are typed", 
this place could be the Compiler_ method. 
Is this a good idea? Any drawbacks?

Thanks again
Lutz



**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to