|
Xiija Beginner
Joined: 24 Apr 2018 Posts: 10
|
Posted: Tue Apr 24, 2018 3:52 am
logical not syntax |
cast bloodsong
{@bsong = !(@bsong)}
#echo Bloodsong: @bsong
also tried
@bsong = !(@bsong)
@bsong = !@bsong
none of these work,
can i use a not operator in zmud? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Tue Apr 24, 2018 5:20 am |
The issue is with your parenthesis I believe
#IF (@bsong = !@bsong) {#echo Bloodsong: @bsong}
Of course, a given variable will always be equal to itself. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Xiija Beginner
Joined: 24 Apr 2018 Posts: 10
|
Posted: Tue Apr 24, 2018 5:40 am . |
( tried your idea, didn't work :( ... )
was just trying to do a basic math thing like in most programming languages...
var a = 0
a = !a
( now a is equal to 1 )
a = !a
( now a is equal to 0 again ) |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Wed Apr 25, 2018 2:55 pm |
Ah, silly me.
We are notting the variable instead of the equal sign.
#IF (@bsong!=@bsong) {will never be true} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Xiija Beginner
Joined: 24 Apr 2018 Posts: 10
|
Posted: Wed Apr 25, 2018 6:31 pm |
tried that, no go :(
i guess it's not possible in zmud?
i just did this...
#IF (@bsong = 1) {@bsong = 0} {@bsong = 1}
#ECHO Bloodsong: @bsong |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Wed Apr 25, 2018 7:04 pm |
you define it as:
bsong=0
bsong=1
you only use the @ symbol when you want to reference the current value of bsong |
|
_________________ Discord: Shalimarwildcat |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Wed Apr 25, 2018 7:11 pm |
further testing shows that (!0) and (!1) do return the boolean reciprocals as well
#IF (!@bsong) {bsong=0} {bsong=1} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|