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 »

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 »

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 »

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

Thank you so much!
Post Reply