------ art_40002_8741820.1156964214853 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Martin, Why can't you use .ini files? Or, better yet, use a RDBMS or BerkleyDB to hold them? rr On 8/30/06, eatmyjunk / gmail.com <eatmyjunk / gmail.com> wrote: > > I have a few variables for a program I am attempting to write that I > need to be able to read into my script. However, certain ones take on a > different scope than others, so I would like to separate them out into > groups (in different files, hopefully). It is for film production, so > I'll try to break it down with that in mind. I hope I'm clear enough. > > The groupings are: > 1. Variables that are used every time the script is run, and never (or > nearly never) change, such as the project name. > 2. Variables that remain the same for every time the script is run on > certain shot, but are unique to only that shot, such as the length. > 3. Variables that change every time the script runs, such as the render > version or the date (not taken from the system time, unfortunately). > These variables should also be able to compute what the correct file > for group 2 variables are. > 4. Variables that are calculated from the previous 3 groups and are > unique with each running of the script, such as the filename of the > file to be rendered, and its output. > > What I have got working so far is to set all my variables in four > files, however, I have to manually specify them in the main .rb script. > Additionally, I can only seem to get it to work with $variables, and > nothing else. For now, I'd like to have the ruby script run with a flag > to tell it where to start looking for the variables, and be able to > pass them on and calculate them until they all get back to the main > script. > > Here's an example: > > (in instance_variables.rb) > $shotScene 0 > $shotShot > $shotVersion > ... > > (in main.rb) > require 'environment_variables.rb' > require 'instance_variables.rb' > require 'shot_variables.rb' > require 'calculated_variables.rb' > ... > > Although I have not yet set it up, I also want to integrate this group > of variables (1, 2, 3 and 4) into a database (rails?), so that I can > have a sort of queue (queued, currently running, and logged entries). > Although I'll try to muddle my way through a bit more before I > integrate a db back end, I need to have a solution that can look > forward to that eventuality. > > Cheers, and thanks, > Martin > > > -- Ron Reidy ------ art_40002_8741820.1156964214853--