Hi,

I am getting a wierd error, whenever I have a nested loop, I have checked the length of array data its 1. The error read as below:

irb(main):208:0> while rec_ctr < data.length
irb(main):209:1>
Display all 375 possibilities? (y or n)
==                             cwws
===                            d
=~                             data
ARGF                           def

 

 

I have been getting this error for sometime, have no clue whats wrong spents hrs together to know whats wrong, but got no success if any of you have overcome this issue splease guide me (Desperately need to get a work around for this)

Here is my code:

require 'win32ole'
excel = WIN32OLE::new('excel.Application')
data = "">workbook = excel.Workbooks.Open('D:\Vishal\RMS_Automation\Data.xls')
worksheet = workbook.Worksheets("Sheet4") #get hold of the first worksheet
worksheet.Select
excel['Visible'] = true

# select the range where data is present, -4121 will fetch last valid data row.4162
#worksheet.range("J1").select
temp = "A2:" + worksheet.range("J1").end(-4121).address

# create range so that you can get number of rows.
range = worksheet.range(temp)
noofrows = range.rows.count
(1..noofrows).each{|i|data = "">

#data.length
rec_ctr =0

while rec_ctr < data.length
 ind = 0 
 while ind < 2
   puts data[rec_ctr][ind].to_s
   ind += 1
   end
  ind = 0
  rec_ctr+=1
 end

 


 

Join SQAtester.com Community ---> http://www.sqatester.com/testersarea/joinus.htm
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to