----- Original Message -----
From: "Kerry Thompson" <[EMAIL PROTECTED]>
> >
> > Then you will get different results depending on the apparently random
> > output from this function with a single known input. That's not good
> > from
> > an engineering POV.
>
> Ah, but you will get consistent results with your code. You're testing
> for void first, just like I found I needed to do.
No, that's not the problem here. The problem is that value("") *randomly*
returns 0 or VOID, when it should clearly always return one or the other (it
doesn't matter which, as long as the same input gives the same output).
Secondly, I am quite aware of the exact nature of VOID. VOID is a special
type/value. The VOID /type/ can have one value: VOID. The /value/ VOID is
numerically equivalent to the value 0 for the integer type, or 0.0 for the
floating point type. These are not /identical/, because the types are
different. However, there is implict casting between all 3 types for all
arithmetic and logical operations in Lingo. As I said before, 0 = 0.0 =
VOID. However, 0 !== 0.0 !== VOID.
VOID is not the "absense of a value" at all, it is a perfectly valid value.
The only problem with that statement is that in practise it can cause
problems with list properties whose values are set as VOID since Lingo
doesn't have any good functions to /distinguish/ between that condition and
the complete absence of the property. I'm talking about the fact that
getaProp returns VOID for non-existant properties, and this is sometimes the
only way to check. This could be solved by the addition of an "isAProp"
proplist function, but its not something that can be done in Lingo, it must
be added to the language.
BTW, you should not confuse VOID in Lingo with void in C: they are quite
different. In C it /does/ indicate the absence of a value (but don't confuse
a void pointer with a null pointer either, they are also quite different).
However, the C void keyword has two possible and quite different meanings,
depending on the context, but there is no VOID type, nor is there a VOID
value.
Regarding your bug, I'm *very* surpised if MACR marked:
if( VOID ) then
-- Never execute this code
-- But it runs on Windows
end if
as NAB, because it clearly is a bug, if the above statement were true.
However, it doesn't evaluate as true on any Windows system I've ever tested
(I even double checked on mine just now to be sure). I expect that the bug
actually lay in your conditional expression, which may not have been
returning VOID as you believe. I'd be interested to see the /exact/
conditional expression though, if you still have a note of it.
- Robert
[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!]