yuppicide, on Wed Dec 30, 2009 7:56 PM, said:
That was a mouthful, Michael. Almost sounded like a limerick, but I understand thanks.
You're welcome.

But I'd say I was wrong when I said
Quote
more exactly, it means "is not true."
It really means a "logical negation"-- the logical opposite of whatever follows it. So if something is true, !something is false-- but if something is false, !something is true.
In the 'if' statement, the 'then' portion will be performed only if the portion between 'if' and 'then' is true-- "if something then dothis" would mean "if 'something' is true then do 'dothis'." 'Something' could be an exp
ression containing one or more variables, constants, and operators, as in "if a = b + c then dothis" (which would perform 'dothis' only if the exp
ression "a = b + c" evaluates to a true condition-- i.e., "yes, a is equal to b plus c"). But 'something' could also be simpler, like a single variable. For example, "if a then dothis" means "if 'a' is true then do 'dothis." If you've only ever seen 'if' statements that contain exp
ressions, then "if a then dothis" might look like an incomplete statement, but it's valid. In this case, 'a' will be false if it equals 0, and true if it equals anything other than 0, so "if a then dothis" is the same as "if a <> 0 then dothis," whereas "if !a then dothis" is the same as "if a = 0 then dothis."
I suppose the reason batari Basic uses something like "if w{0} then dothis" and "if !w{0} then dothis" for bit variables is because a bit can be only 0 or 1, so there's no need to check for any other values (like "w{0} = 36"), and "if w{0}" or "if !w{0}" is shorter than "if w{0} = 1" or "if w{0} = 0," respectively-- also, they're much simpler and quicker to parse.
Michael