From: Brian Adkins Date: 2008-11-08T01:33:03+09:00 Subject: Re: Array variable. Andreu writes: > Please consider the following code: > > def myfunct > > ie = 0 > 0.step(il, 3) do |i| > dmy = ilines[i+1] > icatn[ie] = dmy[2,5] > idate[ie] = dmy[18,5] > ie += 1 > end > > me = 0 > 0.step(ml, 3) do |j| > dmy = mlines[j+1] > mcatn[me] = dmy[2,5] > mdate[me] = dmy[18,5] > me += 1 > end > > end > > > When the program exits the first loop, the contents of array idate is OK. > When the second loop is exited, the array variable idate have the same > contents as mdate ... > > Any clue welcomed, thanks, Andreu. You've left out some important info, but aren't you assigning the same values to both arrays? idate[ie] = dmy[18,5] ... mdate[me] = dmy[18,5] -- Brian Adkins http://www.lojic.com/ http://lojic.com/blog/