PT
Developer Forums
Register
Login
AppGameKit Classic Chat
->
[SOLVED] What does ~~ mean in Tier 1 code?
<
1
>
D
DavidAGK
Joined:
1st Jan 2014
Location:
Posted:
15th Jan 2021 10:59
I'm looking through some encyption code kindly supplied by BatVink a while back and can see there's a "~~" in the code (SetMemblockByte(mbMain, n-40,GetMemblockByte(mb, n) ~~ val(mid(cCODE,codeCounter,1)))
What does
~~
mean?!?
L
Loktofeit
Joined:
21st Jan 2009
Location:
Sarasota, FL
Posted:
15th Jan 2021 11:27
I'm not sure why, but I remember something about that turning a FLOAT into an INT.
R
Ranietz
Joined:
2nd Sep 2004
Location:
Norway
Posted:
15th Jan 2021 18:38
~~ is the bitwise XOR operator. You can read about bitwise operators at the bottom of this page:
https://www.appgamekit.com/documentation/principles/2_operators.htm
D
DavidAGK
Joined:
1st Jan 2014
Location:
Posted:
16th Jan 2021 10:54
Great thanks! I did search the manual.... but ~~ didn't return anything! Ha ha!
P
Phaelax
Joined:
16th Apr 2003
Location:
Metropia
Posted:
21st Jan 2021 3:09
It's a tilde ~ not a dash -
D
DavidAGK
Joined:
1st Jan 2014
Location:
Posted:
22nd Jan 2021 12:27
Yes thanks.
N
n00bstar
Joined:
9th Feb 2004
Location:
Montreal, Canada.
Posted:
23rd Jan 2021 19:30
Super useful for toggle switches.
Instead of:
+ Code Snippet
If XXX = 0 Then XXX = 1 Else XXX = 0
use:
+ Code Snippet
XXX = XXX ~~ 1
D
DavidAGK
Joined:
1st Jan 2014
Location:
Posted:
3rd Feb 2021 11:26
Aaah! Cool! I'll use that!