From: sto.mar@... Date: 2013-05-20T05:55:48+09:00 Subject: Re: new, with an idea, and not sure what to learn next Am 19.05.2013 22:31, schrieb Matt Lawrence: > On Mon, 20 May 2013, Wendy Randquist wrote: > >> But I want to be able to run this program multiple times... one of my >> problems here is that, I can create an array with my hours, then ask for >> input (how many hours today? for instance), and add the input into that >> array, then sum all of the hours in the array. But once the program is >> finished running and I run it again... the array is back to square one. >> What kind of knowledge do I need to make it so I can create a program >> that would save new data even after I closed it? What do I need to start >> googling, above and beyond Ruby syntax, to understand how to do a >> project like this? What other sources are there for learning how to do >> things like divide time in pay periods and having the program deal with >> real-time? > > You need some form of persistent data storage. For me, I had a similar > problem recently so I set up MySQL and am using the Sequel gem to > provide a simplistic (and not even relational) data store. Using Sqlite > would be even easier for your application. For simple file-based storage where no relational database is needed there's also e.g. - YAML::Store - CSV - File.open(filename, 'w'), combined with YAML.dump/YAML.load_file or plain text That's probably easier to play around with at the beginning and does not require setting up a MySQL server. --