Condition quiestion

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
Rogelio
Newbie
Posts:6
Joined:Sun Oct 26, 2003 2:51 am
Condition quiestion

Post by Rogelio » Mon Oct 27, 2003 5:08 am

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

Dr_Davenstein
QBasic God
Posts:166
Joined:Tue Mar 25, 2003 12:45 am
Location:U.S.A.
Contact:

Re: Condition question

Post by Dr_Davenstein » Tue Oct 28, 2003 4:38 am

You can use the XOR function for a toggle switch...

Code: Select all

LOOP
A% = A% XOR 1
Print A%
DO
Come check out [url=http://www.freebasic.net/forum/index.php]FreeBASIC[/url]. The syntax is based on QuickBasic, but it expands to use pointers, operator overloading, etc... The list goes on and on!

Rogelio
Newbie
Posts:6
Joined:Sun Oct 26, 2003 2:51 am

Re: Condition quiestion

Post by Rogelio » Tue Oct 28, 2003 10:16 am

That's exactly what I was looking for.  :)

Thank you so much!

Post Reply