X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 12 Feb 2009 06:42 AM by  anon
Problem adding a user defined function to ENVI.
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
12 Feb 2009 06:42 AM
    Hello. I'm trying to add a function to ENVI that enables me to load a 3rd party file type. Currently the script I have works fine, but only if I load ENVI with the "ENVI + IDL 4.5" icon. If I try loading IDL without IDL then the menu item does not appear. The script is saved as a .pro file, which I think may be the problem. However, if I try saving as a .sav file (using 'save, /ROUTINES, 'chipstoenvitiff4_define_buttons', 'chipstoenvitiff4', FILENAME = 'D:\Program Files\ITT\IDL70\Products\envi45\save_add\chipstoenvi.sav' ) then the menu button doesn't appear, no matter what method I use to load ENVI.   If someone could explain what I've done wrong here then that'd be superb.   Simon.   If it's useful, my define buttons function is as below: pro chipstoenvitiff4_define_buttons, buttonInfo     compile_opt idl2   envi_define_menu_button, buttonInfo, value = 'CHIPS', $     event_pro='chipstoenvitiff4', POSITION=1, ref_value = 'Generic Formats', uvalue='CHIPS' end

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    12 Feb 2009 08:36 AM
    If it works as a .pro and adds your button in the expected location and runs, then it is probably a compile issue.  Be sure to do the following when creating your .save file: - open it in IDL only - compile the code - do a resolve_all IDL>resolve_all, /continue_on_error, skip_routines='envi' - then the SAVE procedure IDL>save, file='my_function.sav', /routines This should create a proper .sav file.  If, however, your routine does not add the button or function as expected when in the save_add directory as a .pro, then there is something going on in the code itself.

    Deleted User



    New Member


    Posts:
    New Member


    --
    13 Feb 2009 06:51 AM
    I'd forgotten to use the "resolve_all" step, once I did that the thing works fine.   Thanks.
    You are not authorized to post a reply.