Conditional Array Definitions
John Esak
john at valar.com
Sat Nov 27 14:48:35 PST 2004
> John:
> ...
> As for the rest of your statement, this depends on how filePro has been
constructed. I assume > that at runtime, if the If statement is not true,
then the array is not defined; otherwise, it > is.
Do not assume this becdause it is not true. Arrays do not depend in any way
on "if" conditions. They are always brought into existence wherever they are
on the table, even after an "END" statement.
> If you are correct that the array is defined whether the programmer wanted
it to be or not, at > runtime, then I would consider that to be very strange
relative to most other computer
> languages. It is certainly counter-intuitive. Given the tremendous
amount of RAM most
> computers currently have I suspect it's not much of problem now, but it
still could be in some > instances.
> Regards,
> RWS
> transpower at aol.com
Well, there are a whole lot of things in filePro that might be
counter-intuitive. How about starting off most input processing tables with
"END". Or bringing variables into existence anyware on a table, even after
an "END" statement? They are not dependent on any "if-condition" and that
probably hasn't bothered you... why should it with arrays? Of course, if
you want to assign a value to a variable, this will certainly respect any
if-condition, same with arrays. As for defining them, though, both act
exactly alike and have since day one, versoin <1.0. The trick of working
well in any programming language is not intuiting how it works, but learning
how it is meant to work and following those rules. So, you're telling
someone that something works the way you _think_ it should rather than the
way it does... doesn't work too good. :-) I'm surprised this didn't bite
you in the past since you thought it worked the other way. Normally, one
should try a thing out before giving an answer about it. In any case, I
wasn't going to answer your note and explain that you were wrong... but, you
answered after several other people had just given the correct anser,
including Ken, who wrote filePro, has the source in front of him and _knows_
the answer, period. However, this question has been floated dozens of times
over the years and generally is a very well known mecahnism to filePro
programmers who have frequented these forums.
I appreciate what you are saying about it seeming counter-intuitive, but
then a lot of things in FP would fit that bill. :-) Yet, in the large sense
of having used the product for 2 and half decades, it all makes perfect
sense to me... and to be honest, always has. The pre-compiling of arrays,
variables, labels, etc., all the pools, makes great and natural sense to me.
The only other languages I program in, though, are BASIC, and C. They have
no problem with this methodology.
More information about the Filepro-list
mailing list