sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    True/false toggle?

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 197 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Chris FullmerC Offline
      Chris Fullmer
      last edited by

      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

      Lately you've been tan, suspicious for the winter.
      All my Plugins I've written

      1 Reply Last reply Reply Quote 0
      • fredo6F Offline
        fredo6
        last edited by

        Chris,

        Personally, I just use

        reverse = !reverse
        
        1 Reply Last reply Reply Quote 0
        • Chris FullmerC Offline
          Chris Fullmer
          last edited by

          Aha! That does precisely what I was hoping for! Thanks Fredo,

          Chris

          Lately you've been tan, suspicious for the winter.
          All my Plugins I've written

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement