From: 12 34 Date: 2007-08-01T04:55:19+09:00 Subject: Re: Passing variables to a required file Robert Klemme wrote: > 2007/7/30, 12 34 : >> EOS >> > I'd suggest to refactor your code so you have multiple classes and can > instantiate them with appropriate parameters. Storing code in a long > string is a bad option if the code is known at compile time which > seems to be the case here. > > Kind regards > > robert This is getting over my head, but the code that is a string will be changed on running the script. I'll be putting in variable via #{variable}. As I understand it this string is sent to a Mac application that puts up a GUI window and then returns the options (text, filenames, etc) entered in a hash. I'm using the initial #{variable} to put in default selections in the GUI. They could be written in the original script, but I'd rather keep them in the main script. And I envision transitioning to other GUI's if this one doesn't work out or I learn Rails or who know what? If I should still do as you say, let me know and I'll study some more. As I may have said earlier, I've only used defs (and I use them liberally for what I think is the usual reason to keep the code easier to read). Although I've worked through some tutorials and Ruby on Rails stuff, I haven't quite got my head around classes and instantiation. My script / app will be run each time I download photos and set them up for transfer to my photo program (Aperture). I'm not saving any of the information except defaults which at the moment I'm hard wiring into the code, but may set up a YAML to save the last selections which then become the defaults. I've also set myself the task of (re)reading PickAxe on my vacation which starts next week. Thank you for your comments. -- Posted via http://www.ruby-forum.com/.