IF Boolean_Logic = Inconsistent Then IsBug()

BlitzMax Forums/BlitzMax Programming/IF Boolean_Logic = Inconsistent Then IsBug()

I hope your not trying to include me in your tellingoff
Not really, no. Null represents an object (or String) that doesn't exist, so from a semantical point it makes sense that when objects are evaluated as a boolean expression, objects that exist return true, while objects that don't return false. I agree that Null (as a value, if we can call it that) is neither inherently true or false. However it does obtain boolean significance when evaluated in a specific context. The same is true for numbers.

The number 10 is neither true nor false, so why does it evaluate to true?
Because the expression 10 evaluates to true.

Why is 10 true, but 0 false?
Because '10' belongs to the set of integers that, when used as an expression, in most computer languages evaluates to true, where as '0' does not. It's not really arbitrary, it's how (as Defoc8 pointed out) the CPUs instruction set is hardwired.

If it's any consolation, the OS works exactly oposite. In the OS, a returncode of "0" usually means success where as increasingly large numbers represent increasingly severe errors.