471,873 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,873 software developers and data experts.

toggles the value?

How do I do this? This is a basic computer programming question, so it should be very easy.

Write a statement that toggles the value of onOffSwitch . That is, if onOffSwitch is false, its value is changed to true; if onOffSwitch is true, its value is changed to false.
Sep 18 '06 #1
1 6019
293 100+
Expand|Select|Wrap|Line Numbers
  1. toggle = !toggle;
It's the logical NOT operator. NOT(true) = false, NOT(false) = true.
Sep 19 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by otto | last post: by
3 posts views Thread by Eric Chang | last post: by
13 posts views Thread by Stumped and Confused | last post: by
1 post views Thread by Dan | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.