BTW, sorry if you took offense at my comments, they are more a question of
disbelief that Macromedia would regard VOID = true as not a bug than
anything to do with your own credibility - though we do all make mistakes,
which is easier to believe.
It's not that void = true; it's that in some cases implicit testing can lead to erroneous positives.
I can believe what you say is true, but I still
don't accept the logic. VOID = 0 = false, always. As far as I am concerned,
that is, or should be, gospel.
But void is not zero, any more than, in C:
int foo;
makes foo a valid variable. You don't know what's in it and testing it without first stuffing a value into it:
int foo = 3;
can lead to all kinds of weird problems.
I guess I'm looking at it from a somewhat different perspective in that void = undefined, which is not the same thing as either 0 or false. It smells to me more like programmer error. :\ In that light perhaps individual reaction to these results is based on perspective or what one expects from a language -- when we have tests such as voidP, integerP, floatP, stringP and so on, though, it seems to me that it's most advisable to use these tests to preprocess variable contents before we start implicitly assigning actions based on boolean assumptions that can go wrong simply because of unexpected type coercion.
You might also see that I'm of the "don't ever do that" frame of mind in re handling voids and assuming them to have any useful (or at least non-void) value at all. ;) To me void = void, not 0 or false or "" or [:] or anything else, so testing it implicitly for a boolean value, to me, is an error in procedure.
Presumably the bug can be reproduced on any affected system with:
a = VOID
if( a ) then
alert( "This system has a BUGGY implementation of Lingo, no matter what
Macromedia may say" )
end if
It shouldn't matter what the steps leading up to this point are, since VOID
is VOID is VOID, no?
Void is void but it's not necessarily true *or* false. The above might be better written as
if not voidP ( a ) then
if a then
alert etc.
end if
end ifImplicitly casting a void as a boolean is risky. Director doesn't seem to handle the coercion with complete consistency. For that reason the best thing to check for is a voidP or, barring that, an explicit test for a boolean:
if a = TRUE then
alert etc.
end ifrather than allowing Director to try to infer what you mean by context.
Warren Ockrassa | consulting | programming | [EMAIL PROTECTED] nightwares LLC | http://www.nightwares.com/ Developer | Structor, a presentation development/programming tool Info and demo | http://www.nightwares.com/structor/ Author | Director 8.5 Shockwave Studio: A Beginner's Guide Chapter samples | http://www.nightwares.com/director_beginners_guide/
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
