From: Brk Anl Date: 2010-04-07T15:50:06+09:00 Subject: Re: Parse the data in an array index in ruby Actually i try to fill a table class Sorm_Table def initialize # define table structure and array for data @template = Struct.new(:nofcall,:obj,:rpn,:rac,:cg1,:cgpn,:cd1,:cdpn,:stt) @data=Array.new(1000){Array.new()} @obj=['10000','10016'] end # initialize def add_row(_nofcall,_obj, _rpn,_rac,_cg1,_cgpn,_cd1,_cdpn,_stt) s=@template.new(_nofcall,_obj, _rpn,_rac,_cg1,_cgpn,_cd1,_cdpn,_stt) @data[$indx] << s $indx=$indx+1 end after i call add row func tbl.add_row($callno,tbl.obj[$index2],final_data[Enum::PN2],final_data[Enum::AC2],final_data[Enum::PN1],final_data[Enum::AC1],final_data[Enum::PN2],final_data[Enum::AC2],'nACT') i try to add these datas like @data[0][0]=$callno @data[0][1]=tbl.obj[$index2] so i can reach the $callno of the fist row of the table easily but now @data[0] carries all of the data i can not seperate. Cause of this i am trying to split. How can i do it? -- Posted via http://www.ruby-forum.com/.