X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 20 Jun 2003 05:34 PM by  anon
Creating array of objects in subobject
 0 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
20 Jun 2003 05:34 PM
    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
    You are not authorized to post a reply.