I agree Erik, anything that is NOT 0 is true.
FYI with COM, its generally recognized that when forced to specify a value for TRUE, everyone uses -1. Its interesting to note however that when Kixtart evaluates NOT 0, it returns a 1 (which to my mind, is intuitively a better TRUE than -1 is) and I think why this situation occured has more to with with the history and legacy of Kixtart more than anything else, even though the NOT operator was added late in the game (not sure really).
I know that we're talking around isoteric issues here, but does it make sense to leave FALSE as an unspecified value that is NOT 0 ? Im cool with it because I tend to pratice poor coding habits anyways. Break more rules than I follow thats to be sure. The question really becomes, is a statement like this best pratice:
code:
if $bFlag
; then do something true
else
; do something else false
endif
because that would be the impact of leaving boolean TRUE as un-specified. From what I've seen around this board, this kind of opened-ended if statement expression is frowned upon, fe: the best pratice version of above ?
code:
if $bFlag = 1
; then do something true
else
; do something else false
endif
[edit]
lol - heres a quasi best practice variant:
code:
if not not $bFlag
?"true"
endif
I need some coffee.
[ 01. November 2002, 20:32: Message edited by: Shawn ]