Error loading file
-
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. -
@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...
-
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) endI 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 -
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... -
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 errorI'm editing my script in notepad++
I don't see any reason why that happens
-
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 !!
-
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...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement