IDL Save File Mystery

  • Follow


Folks,

Here is our first mystery for 2010. Consider the following
IDL procedure:

Pro testobjview
   s = obj_New('IDLgrtext', 'This is some text')
   xobjview, s
END

Starting in a fresh IDL session, I execute the following
code as a batch file.

;******************************************************
..compile testobjview
Resolve_All, CLASS=['IDLExobjviewwid',$
                    'IDLExViewGroup', $
                    'IDLExObjView', $
                    'IDLExinscribingview', $
                    'IDLgrText']
IRESOLVE
Save, FILE='C:\IDL\testobjview.sav', /ROUTINES
;*****************************************************

I now exit IDL and drag the save file to the IDL
Virtual Machine. It doesn't run. Tells me to contact
the author of the program. Unfortunately, he is still
drinking rum and cokes in the Bahamas. :-(

I now start up IDL and restore the save file and run
it:

   IDL> Restore, '='C:\IDL\testobjview.sav'
   IDL> testobjview

It runs perfectly and nothing else is compiled in this
new IDL session.

Now, I do the very same thing as before, except this time
in the batch file I actually call TextObjView instead of 
compiling it:

;******************************************************
testobjview
Resolve_All, CLASS=['IDLExobjviewwid',$
                    'IDLExViewGroup', $
                    'IDLExObjView', $
                    'IDLExinscribingview', $
                    'IDLgrText']
IRESOLVE
Save, FILE='C:\IDL\testobjview.sav', /ROUTINES
;*****************************************************

This time, when I exit IDL and drag the save file to the
Virtual Machine, it runs perfectly.

What in the world is going on here!? My theory, obviously,
is that something is *not* getting compiled. But, what!?

Cheers,

David

P.S. Those of you who try this in a version of IDL that is
*not* 7.1 will need to substitute "ITRESOLVE" for "IRESOLVE".
The routine has been renamed in IDL 7.1.

-- 
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
0
Reply David 1/8/2010 4:08:18 AM

David Fanning writes: 

> I now exit IDL and drag the save file to the IDL
> Virtual Machine. It doesn't run. Tells me to contact
> the author of the program. Unfortunately, he is still
> drinking rum and cokes in the Bahamas. :-(

With a CATCH error handler in the TestObjView
program, I get the following message in the VM:

   %XOBJVIEW: Unable to invoke method on NULL object reference:
   <OBJREF (<NullObject>)>.
   % Execution halted at XOBJVIEW 
   %                TESTOBJVIEW
   %                IDLRTMAIN
   %                $MAIN$

Not all that helpful, unfortunately. :-(

Cheers,

David



-- 
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
0
Reply David 1/8/2010 5:01:23 AM


I tried it in Linux, and had the same problem, but it did indicate
some of the origin, as running testobjview after the restore caused
IDLEXVIEWMANIP__DEFINE to be compiled.

The two save files were 7.9MB and 8.0MB. Looking at the routines in
them, one had 4120 routines, and the other, 4147. After the surprise
that there were so many routines, I got the names of the 27 not
present in the first save file:

+% RESTORE: Restored procedure: IDLEXMODELMANIP::BUILD_MANIP_VISUAL.
+% RESTORE: Restored procedure: IDLEXMODELMANIP::CLEANUP.
+% RESTORE: Restored procedure: IDLEXMODELMANIP::GETPROPERTY.
+% RESTORE: Restored procedure: IDLEXMODELMANIP::MOUSEDOWN.
+% RESTORE: Restored procedure: IDLEXMODELMANIP::MOUSETRACK.
+% RESTORE: Restored procedure: IDLEXMODELMANIP::MOUSEUP.
+% RESTORE: Restored procedure: IDLEXMODELMANIP::SETPROPERTY.
+% RESTORE: Restored procedure: IDLEXMODELMANIP::SETTARGET.
+% RESTORE: Restored procedure: IDLEXMODELMANIP::UNDO.
+% RESTORE: Restored procedure: IDLEXMODELMANIP__DEFINE.
+% RESTORE: Restored procedure: IDLEXVIEWMANIP::BUILD_VISUALS.
+% RESTORE: Restored procedure: IDLEXVIEWMANIP::CALCRECT.
+% RESTORE: Restored procedure: IDLEXVIEWMANIP::CLEANUP.
+% RESTORE: Restored procedure: IDLEXVIEWMANIP::GETPROPERTY.
+% RESTORE: Restored procedure: IDLEXVIEWMANIP::MOUSEDOWN.
+% RESTORE: Restored procedure: IDLEXVIEWMANIP::MOUSETRACK.
+% RESTORE: Restored procedure: IDLEXVIEWMANIP::MOUSEUP.
+% RESTORE: Restored procedure: IDLEXVIEWMANIP::RESHAPE.
+% RESTORE: Restored procedure: IDLEXVIEWMANIP::SETPROPERTY.
+% RESTORE: Restored procedure: IDLEXVIEWMANIP::SETTARGET.
+% RESTORE: Restored procedure: IDLEXVIEWMANIP__DEFINE.
+% RESTORE: Restored function: IDLEXMODELMANIP::GET_VIEW.
+% RESTORE: Restored function: IDLEXMODELMANIP::INIT.
+% RESTORE: Restored function: IDLEXMODELMANIP::V_TO_DATA.
+% RESTORE: Restored function: IDLEXMODELMANIP__GET_BOUNDS.
+% RESTORE: Restored function: IDLEXMODELMANIP__QUATERNION_M3.
+% RESTORE: Restored function: IDLEXVIEWMANIP::INIT.

Which turned out to be every IDLEXMODELMANIP and every IDLEXVIEWMANIP.
But there was no message indicating that IDLEXMODELMANIP__DEFINE got
compiled when I run testobjview after a restore.
0
Reply pp 1/8/2010 5:18:09 AM

I've had a program which has suffered from this same problem for
several years. I always had to run the make file, then the program,
call up the xobjview window, and resave before it would work in the
VM. Adding idlexmodelmanip__define and idlexviewmanip__define to the
make file seems finally to have fixed it. Many thanks pp!

Greg

0
Reply greg 1/8/2010 12:02:59 PM

pp writes: 

> Which turned out to be every IDLEXMODELMANIP and every IDLEXVIEWMANIP.
> But there was no message indicating that IDLEXMODELMANIP__DEFINE got
> compiled when I run testobjview after a restore.

Thanks for this. The absence of these two objects appears
to be the problem. I think the *real* problem, however,
is that IDLexModelManip is created with "COMPILE_OPT hidden"
in all of its methods, including the definition method,
which essentially makes it invisible to all but the most
persistent observer. What could possibly be the purpose
of this? 

Cheers,

David


-- 
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
0
Reply David 1/8/2010 1:54:15 PM

David Fanning <news@dfanning.com> writes:

> ;******************************************************
> .compile testobjview
> Resolve_All, CLASS=['IDLExobjviewwid',$
>                     'IDLExViewGroup', $
>                     'IDLExObjView', $
>                     'IDLExinscribingview', $
>                     'IDLgrText']
> IRESOLVE
> Save, FILE='C:\IDL\testobjview.sav', /ROUTINES
> ;*****************************************************
> ;******************************************************
> testobjview
> Resolve_All, CLASS=['IDLExobjviewwid',$
>                     'IDLExViewGroup', $
>                     'IDLExObjView', $
>                     'IDLExinscribingview', $
>                     'IDLgrText']
> IRESOLVE
> Save, FILE='C:\IDL\testobjview.sav', /ROUTINES
> ;*****************************************************


They're not exactly the same.  The second one is calling testobjview
that might cause some extra compilations to occur?

Matt

-- 
Matthew Savoie  -  Scientific Programmer
National Snow and Ice Data Center
(303) 735-0785   http://nsidc.org
0
Reply savoie 1/8/2010 2:56:12 PM

5 Replies
466 Views

(page loaded in 0.212 seconds)


Reply: