~~ Operator
Newzed
Posts: 2,503
Is out[noparse][[/noparse]a]~~
the same as out[noparse][[/noparse]a] := 0
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
the same as out[noparse][[/noparse]a] := 0
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My computer, http://forums.parallax.com/showthread.php?p=630466
is the same as outa[noparse][[/noparse]pin] := 1
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
Also, don't forget that, when used with variables, the ~~ operator sets all the bits to 1s.
-Phil
and that outa[noparse][[/noparse]pin]~ is the same as outa[noparse][[/noparse]pin] := 0
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
When you use variable~ or variable~~ in an expression, the value returned is the value BEFORE the clearing or setting.
Example:
··if Flag~·········'Read and clear flag
··· DoSomething·· ·'Do something if flag was set
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
When used as a prefix, the meaning of these two operators changes entirely. Rather than pre-setting or -clearing a variable (which wouldn't be all that useful), it sign extends either bit 7 (~variable) or bit 15 (~~variable).
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The more I know, the more I know I don't know.· Is this what they call Wisdom?
How to remember:
~ looks "less" than ~~ and 0 is less then 1
And the "1" is not a good alternative: x~~ corresponds to x := TRUE
And though it makes programs UNREADABLE it is faster than the corresponding assignment...
-Phil