>Possibly, I remember this from the time that the help system was
>delivered on chiseled stone tablets, but I believe that the compiler
>cannot evaluate all elements in a compound if statement because to do
>so would be too daunting a task. Chief among the problems is that VFP
>will evaluate function calls in the statement and it also allows for
>screwy logic like
>
>if foo1() or foo2() etc,,,,
>
>where foo1() may actually create or alter memvars used by foo2().
>
>Isn't there also an issue re short circuit logic? Possibly this is a
>system setting, but if short circuit prevails and foo1() returns .f. ,
>there's no reason to evaluate foo2(). OTOH, it's also possible to
>write poor code that requires foo2() if fire for the same reasons
>cited above.
I think this is called "lazy evaluation", but I don't see how it can apply
to a series of OR expressions in an IF statement since the system can't
know what the IF evaluates to at all until it's looked at all the ORs.
But even if that does explain why the compiler doesn't find my original
error, it doesn't explain why it doesn't choke on a single comparison
expression that expects a string literal to evaluate as boolean.
Yeah, in C or C++, a single-character string literal evaluates as "true"
because any positive integer in those languages evaluates as
"true"--because they are treated as variables of type char, which is a
1-byte integer. VFP would override an equals (= or ==) operator to avoid
that situation, but in:
IF ")"
* Do something
ENDIF
There's no operator. Maybe that's it? VFP is reverting to the underlying C
language in that case? But only during the compilation, because trying to
execute that code will produce a data type mismatch error.
Still scratching my head...
Thanks.
Ken Dibble
www.stic-cil.org
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.