Tab Julius wrote:
> 
> Value(0) and value("0") evaluate to 0.
> 
> VOID is considered 0 for evaluation purposes.
> 
> Generally in programming, a null or void pointer is all 0's, and Director
> continues with that in Lingo.
> 
> So, this can be very convenient actually, particularly for evaluating
> parameters that weren't passed in.  For instance:
> 
> on myFunction skipCompatibilityTest
>     -- Unless turned off, first check if they're compatible
>    if (not skipCompatibilityTest) then
>      runCompatTest()
>    end if
>    -- do other things
> end
>

One gotcha I hit just minutes ago (synchonicity? serendipity? you decide):

If the parameter you're passing is not an integer, you have to test to
see if the parameter =/<> void, otherwise it barfs when you DO pass it a parameter.

Text, points, RGBs, rects, quads... none of these evaluate to either
true or false on their own. It's gotta be an integer.

-- 
Carl West    [EMAIL PROTECTED]
617.262.8830 x246    

I have no superfluous leisure; my stay must be
stolen out of other affairs; but I will attend you awhile.

           - Isabella, Measure for Measure, Act 3 Scene 1

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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!]

Reply via email to