| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| Mr B 
 
 
 
 Joined: 20 Mar 2003
 Posts: 382
 
 
 | 
			
				|  Posted: Tue Sep 14, 2004 1:30 pm    Post subject: Equivalent of NOT Operator |   |  
				| 
 |  
				| What is the equivalent of a NOT operator?  I am trying to retrieve a tage value and toggle it.  Would this work as well? 
 
  	  | Code: |  	  | set tag(tag:lantern, (get tag(tag:lantern),XOR,true)) | 
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Moogle1 Scourge of the Seas
 Halloween 2006 Creativity Winner
 
  
 
  
 Joined: 15 Jul 2004
 Posts: 3377
 Location: Seattle, WA
 
 | 
			
				|  Posted: Tue Sep 14, 2004 3:24 pm    Post subject: |   |  
				| 
 |  
				| That works. I usually say "==false" instead of "NOT." _________________
 
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Machu Righter, a person who rights wrongs
 
 
 
  
 Joined: 09 Jul 2003
 Posts: 737
 
 
 | 
			
				|  Posted: Tue Sep 14, 2004 5:36 pm    Post subject: |   |  
				| 
 |  
				| If you are making a tag toggle, you could say: 
  	  | Code: |  	  | if (check tag (tag:lantern)) then (set tag (tag:lantern, false)
 else (set tag (tag:lantern, true)
 
 | 
 (I'm just saying code off the top of my head; not sure if that's the exact syntax)
 _________________
 
  	  | Code: |  	  | [*]That's it [*]I'm done reasoning with you
 [*]Starting now, there's going to be a lot less conversation and a lot more killing
 | 
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Guest 
 
 
 
 
 
 
 
 | 
			
				|  Posted: Wed Sep 15, 2004 5:57 pm    Post subject: |   |  
				| 
 |  
				| If you want a logical NOT, 'x == false' works fine, as well as many other expressions. 
 If you want a bitwise NOT (complementary bits), use 'x, xor, -1' (assuming that the sign bit is used in the mask, is it? If not, use 'x, xor, 32767')
 
 
 Which is completely off the subject as the qustion has been answered.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Guest 
 
 
 
 
 
 
 
 | 
			
				|  Posted: Thu Sep 16, 2004 10:02 am    Post subject: |   |  
				| 
 |  
				| Thank you very much.  The "==false" is much less unwieldy (more wieldy?) than my XOR stuff. |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  |