🏢 PlaceMaker | 25% off for February including new Google Earth data imports!
Learn more
True/false toggle?
-
I don't suppose there is some sort of built in toggle method for true and false, is there? Example of how I wanted to use it:
` reverse = false
def (key, repeat, flags, view)
if key == VK_UP
reverse.toggle
end
end #onKeyUp`The .toggle method does not exist, but it is what I was hoping to find, and hoping I just didn't know what it was called. Anything like this in the Ruby language?
Chris
-
Chris,
Personally, I just use
reverse = !reverse
-
Aha! That does precisely what I was hoping for! Thanks Fredo,
Chris
Advertisement