From: Steve Tucknott Date: 2012-11-23T21:49:47+09:00 Subject: Re: Arrays with records as objects Thanks for all the advice. Bear in mind though, that in some cases (not all!) the poor coding was simply because I cut and pasted a line (ie the build of addr_rec) - I wouldn't write code like that in working code. I'll make notes though to the best practice in my test examples (actually it's now one example as I thought I'd bolt all the examples into one module and use arguments and a case to drive it - just to see how arguments and case worked! - once I know how to create libraries, I'll split them back out again!) What I've found odd so far is that Ruby appears to have multiple ways of doing the same thing - so as you say, I could write: line[i] = some_rec or line << some_rec (assuming the index points to the next empty slot) ..and the examples don't appear (so far) to explain the why's and where's and then best practices. Ditto for iteration. All this is my fault , as I was up to array handling, and then googled something I didn't quite follow - and ended up at a site with a 'todo' example that I thought would be good as a mini test module. So I jumped ahead of myself and started faffing around with that and then hit records in arrays etc. Such is the learning curve. Thanks for your patience. -- Posted via http://www.ruby-forum.com/.