• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Error loading file

Scheduled Pinned Locked Moved Developers' Forum
7 Posts 2 Posters 845 Views
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.
  • C Offline
    confitex architure
    last edited by 13 Mar 2008, 22:10

    Hello,
    When I try to launch a newly written script, at sketchup startup, I get the following message that means Error loading file...

    @unknownuser said:

    ^Erreur de chargement du fichier insertc.rb
    C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:210: syntax error name = "insertc.rb"

    I see no reason it happens because I've launched it once and at the second launch, it failed.
    Please, I need your help
    Thank you.

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 13 Mar 2008, 22:16

      @unknownuser said:

      Hello,
      When I try to launch a newly written script, at sketchup startup, I get the following message that means Error loading file...

      @unknownuser said:

      ^Erreur de chargement du fichier insertc.rb
      C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:210: syntax error name = "insertc.rb"

      I see no reason it happens because I've launched it once and at the second launch, it failed.
      Please, I need your help
      Thank you.

      What does line 210 of the script say ?

      Perhaps give a few lines either side too - you don't need to give away the whole script if you don't want to...

      TIG

      1 Reply Last reply Reply Quote 0
      • C Offline
        confitex architure
        last edited by 13 Mar 2008, 22:22

        Hi TIG
        thanks, you're right it would be easier...

        	
        #--------------------------------------------------------
        end		#### END OF CLASS ####
        #--------------------------------------------------------
        
           name = "insertc.rb" #this one is line 210
           unless file_loaded?(name)
              menu = UI.menu("Plugins")
              menu.add_item("insertc") { Sketchup.active_model.select_tool InCompo.new }
              file_loaded(name)
           end
        
        

        I also have these alerts...

        @unknownuser said:

        C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:212: syntax error
        menu = UI.menu("Plugins")
        ^
        C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:213: syntax error
        menu.add_item("insertc") { Sketchup.active_model.select_tool InCompo.new }
        ^
        C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:213: unterminated string meets end of file
        C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:213: syntax error

        1 Reply Last reply Reply Quote 0
        • T Offline
          TIG Moderator
          last edited by 13 Mar 2008, 22:37

             
          end      #### END OF CLASS ####
          #--------------------------------------------------------
          ### Try changing 'name' to something else in case it's clashing with a 'name' variable somewhere else...
             name_of_plugin = "insertc.rb" #this one is line 210
             unless file_loaded?(name_of_plugin)
                menu = UI.menu("Plugins")
                menu.add_item("insertc") { Sketchup.active_model.select_tool InCompo.new }
             end
             file_loaded(name_of_plugin)### Move this outside of 'unless' test...
          
          

          TIG

          1 Reply Last reply Reply Quote 0
          • C Offline
            confitex architure
            last edited by 13 Mar 2008, 22:43

            still got that

            @unknownuser said:

            ^Erreur de chargement du fichier insertc.rb
            C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:210: syntax error
            name_of_plugin = "insertc.rb"
            ^
            C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:212: syntax error
            menu = UI.menu("Plugins")
            ^
            C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:213: syntax error
            menu.add_item("insertc") { Sketchup.active_model.select_tool InCompo.new }
            ^
            C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:213: unterminated string meets end of file
            C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:213: syntax error

            I'm editing my script in notepad++

            I don't see any reason why that happens

            1 Reply Last reply Reply Quote 0
            • C Offline
              confitex architure
              last edited by 13 Mar 2008, 22:53

              There were something wrong with a previous UI.messagebox, mabey a quote problem, I don't realy realize...

              
              	UI.messagebox "Added Bed"
              end #if
              
              end #Place_Component
              #---------------------------
              	
              	
              #-----------------------------------------------------------------------------------------------
              end		#### END OF CLASS ####
              #-----------------------------------------------------------------------------------------------
              
              

              thanks TIG !!

              1 Reply Last reply Reply Quote 0
              • T Offline
                TIG Moderator
                last edited by 14 Mar 2008, 10:42

                Although the SUp Ruby API doesn't stress it, I think it's safer to put things into () after a method:

                So UI.messagebox "A message..." becomes UI.messagebox("A message..."), you are then more likely to spot errors like missing quote closing.

                If you are using Notepad++ (I do too) then set up your Ruby format defaults to say have any strings in red - then if you miss off a closing " everything afterwards is coloured red and stands out as wrong...

                TIG

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

                Advertisement