AnsweredAssumed Answered

vrf VEE's built in True and False constants ??? (Was What's up with Arrays?)

Question asked by VRFuser on Nov 3, 2004
> TRUE and FALSE are really Int32 1 and 0 respectively.

Which is actually kind of perilous for comparing values. The boolean
expression (value == True) is only true if value is 1, but (value != False)
is true for all values of value except 0.

In practice, since VEE is basically a C application it seems reasonable to
assume that one can use C convention to test boolean expressions. That is,
any boolean test of a value is true unless the value is 0 (thinking mainly
of the Triadic expression and If/Then/Else object).

Different languages have different ways of handling this. If I remember
correctly, ANSI C says that:

#define FALSE 0
#define TRUE  (~FALSE)

So the value of TRUE is -1. This is the same in VB and VBA, though the size
of the values are different (32 bits vs. 16 bits respectively).

In general, you can always count on the value of False or FALSE being 0, but
True and TRUE are sometimes not what you expect. Amazing, isn't it?
-SHAWN-


---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

Outcomes