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

    <LocalJumpError: return from proc-closure> in WebDialog

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 4 Posters 1.4k Views 4 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.
    • M Offline
      MartinRinehart
      last edited by

      Google search found a two-year old thread near this topic, which helped me work around a Ruby bug. This post is for the next victim of this bug.

      With smaller models, this code, in an action callback, worked:

      
      # update some stuff
      return if msg.nil? # msg == a callback argument
      
      handle the msg
      
      

      With a large model, it failed, showing the title error. This solved the problem:

      
      # update some stuff
      
      unless msg.nil?
          handle the msg
      end
      
      

      Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

      1 Reply Last reply Reply Quote 0
      • M Offline
        markozeta
        last edited by

        Interesting... Glad the model helped then. Wonder what caused it...?

        BSME - Cal Poly Pomona
        Sketchup Pipe Maniac

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by

          I don't know the finer details yet, but returning from a proc causes the error.

          You also get similar errors if you try to return values from command validation procs.

          This causes an error.

          
          def my_validation_proc
            if Sketchup.active_model.selection.nitems == 1
              return MF_ENABLED
            else
               return MF_GRAYED
            end
          end
          
          

          This does not

          
          def my_validation_proc
            if Sketchup.active_model.selection.nitems == 1
              MF_ENABLED
            else
               MF_GRAYED
            end
          end
          
          

          Hi

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            Rather odd, isn't it, as return is implied in Ruby... no?

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • J Offline
              Jim
              last edited by

              Maybe, but I don't understand it myself. Rather than returning from the proc, the proc itself evaluates, and that is what is returned.

              Hi

              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