This code is demonstrating how IDL programs were written in the 1970s. No one does it this way any more, I hope.
http://www.idlcoyote.com/.../coyote_graphics.php
Basically, it puts IDL into the brain-dead mode of using color indices, and it reads an ASCII data file until the loop finds the end of the file, storing the information it finds there into arrays. These days you would find out how many lines are in the file by using the FILE_LINES function and read the data directly into arrays of the proper size:
rows = File_Lines('reddening_law_seaton.dat')
data = DblArr(2,rows)
header = ""
OpenR, lun, ,'reddening_law_seaton.dat', /Get_Lun
ReadF, lun, header
ReadF, lun, data
Free_Lun, lun
red_lam = Transpose(data[0,*])
red_alam_av = Transpose(data[1,*])
I wouldn't use the code you are showing us as an example of how to write an IDL program. :-)