Page 1 of 1

Condition quiestion

Posted: Mon Oct 27, 2003 5:08 am
by Rogelio
Is there a function that turns on something if its off and viceversa?

For example if you type the letter a, the program checks if its on(1) or off(0), if it has a 1 value then it prints a 0 value, and if it had a 0 value it prints a 1 value.

Please help, or tell me where can I find info on this.  ???
Thanks

Re: Condition question

Posted: Tue Oct 28, 2003 4:38 am
by Dr_Davenstein
You can use the XOR function for a toggle switch...

Code: Select all

LOOP
A% = A% XOR 1
Print A%
DO

Re: Condition quiestion

Posted: Tue Oct 28, 2003 10:16 am
by Rogelio
That's exactly what I was looking for.  :)

Thank you so much!