Craig Demyanovich wrote:
> Looks like you forgot to change this line
> 
> sktylist = Hash.new("")
> 
> to
> 
> sktylist = Hash.new( [] )
> 
> which makes the default value for new elements an empty array instead of 
> a
> string. Only then can you use the << operator to push values on to the
> array.
> 
> Regards,
> Craig

You mean the block form: Hash.new{ [] }
Tim, you don't have to do classes.

f = Info.new("SKTYFutBalances20080415.txt")
@sktylist1 = Hash.new{ [] } #with curly braces
@sktylist2 = Hash.new(0)
f.each do |list|
  # parsing stuff here


  @sktylist1[ @acctnum ] = @sktylist1[ @acctnum ] << value
  @sktylist2[ @acctnum ] += value
end

p @sktylist1
p @sktylist2

regards,

Siep
-- 
Posted via http://www.ruby-forum.com/.