not a biggie - probably my not understanding 'expression'??
was trying to toggle/flip a value between 0 and 1 upon each keypress
'
so I used ABS of a NOT value ABS (NOT toggled) and got an incrementing value !!
'
any thoughts -- - on the ABS(NOT ) situation???
Olzeke51
EDIT - print NOT 2 will show a -3 [??? negative 1's compliment ??]
print NOT -3 will show a 2
PS. Blinky used an AND 1 to flip the IO(led) - but it also increments the value [which I don't want]
ABS & NOT
Re: ABS & NOT
Logical and bitwise expressions in BASIC use the same named function. It depends on context which one gets applied.
toggled = 1
bitwise NOT toggled = &HFFFFFFFE
ABS (&HFFFFFFFE) = 2 ' because &HFFFFFFE = -2
bitwise NOT 2 = &HFFFFFFFD ' which = -3
so ABS (-3) = 3
...
toggled = 1
bitwise NOT toggled = &HFFFFFFFE
ABS (&HFFFFFFFE) = 2 ' because &HFFFFFFE = -2
bitwise NOT 2 = &HFFFFFFFD ' which = -3
so ABS (-3) = 3
...