X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 15 Aug 2003 10:44 AM by  anon
How to do nested objects??
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
15 Aug 2003 10:44 AM
    I have a class that I want to have hold another object. My code compiles without error, however, when I try to run it, I get the error: % Variable is undefined: JWR_CAL_IMAGE_FILE_NAMES. % Execution halted at: JWR_CALIBRATIONNOTES__DEFINE 196 C:\RSI\IDL56\products\envi36\save_add\MultiSpectralImageCalibration__define.pro % OBJ_NEW % MULTISPECTRALCALIBRATION 13 C:\RSI\IDL56\products\envi36\save_add\MultiSpectralCalibration.pro % $MAIN$ The contained object is: PRO JWR_CAL_Image_File_Names__define struct = { JWR_CAL_Image_File_Names, InFileNames:STRARR(251) } END ; PRO JWR_CAL_Image_File_Names__define The containing object is: PRO JWR_CalibrationNotes__define struct = { JWR_CalibrationNotes, InFileName:'', $ PathToDataFiles:'', $ NumberOfNotes:0, $ NotesArray:OBJARR(80), $ CalibImageFileNames:JWR_CAL_Image_File_Names, ROIFileIDs:LONARR(4) } END ; PRO JWR_CalibrationNotes__define I get the error message quoted above when I try to create the containing object: PRO MultiSpectralCalibration ; Create Calibratation File List Object CFL = OBJ_NEW( 'JWR_CalibrationNotes' ) OBJ_DESTROY, CFL END ; PRO MultiSpectralCalibration

    Deleted User



    New Member


    Posts:
    New Member


    --
    15 Aug 2003 10:44 AM
    In the class definition of the containig object it should read CalibImageFileNames:OBJ_NEW() And not CalibImageFileNames:JWR_CAL_Image_File_Names You could put the class name inside OBJ_NEW() as an argument but it dosn't really matter. In the class definition you are just setting up data types and OBJ_NEW() sets the datatype to an object reference. In your JWR_CalibrationNotes::Init method you would initilize the reference like so CalibImageFileNames = OBJ_NEW('JWR_CAL_Image_File_Names') Hope this helps Michael Ficker
    You are not authorized to post a reply.