I have an object that I want to have hold an array of subobjects. I have been trying to use objarr for this purpose, but the IDL manual is pretty thin on how to use it. The containing object references a file. Each element of the array it contains holds the elements of a line of that file. See sample code below does not work.
I don't know how to assign address of 'note' to element of objarr.
PRO JWR_CalibrationNote__define
struct = { JWR_CalibrationNote, Bulbs:0, NadirF_Stop:0.0, DirName:'', $
ZenithF_Stop:0.0 }
END ; PRO JWR_ReadCalibrationNotes__define
PRO JWR_CalibrationNotes__define
struct = { JWR_CalibrationNotes, InFileName:'', $
PathToDataFiles:'', $
NumberOfNotes:0, $
NotesArray:OBJARR(80) }
END ; PRO JWR_CalibrationNotes__define
PRO JWR_CalibrationNotes::ReadNotesFile
ColumnLabels = STRARR(4)
pf = 1
OPENR, pf, self.InFileName
READF, pf, ColumnLabels, FORMAT='(A5,1X,A6,1X,A4,5X,A10)'
; self.NotesArray = OBJ_NEW()
WHILE ( NOT EOF(pf) ) DO BEGIN
note = OBJ_NEW( 'JWR_CalibrationNote', pf )
self.NotesArray[ self.NumberOfNotes ] = note
OBJ_DESTROY, note
self.NumberOfNotes = self.NumberOfNotes + 1
ENDWHILE
END ; PRO JWR_CalibrationNotes::ReadNotesFile, InFile
----------------------------
Thanks for your help
Jon Robinson
|