Re: having a routine .compile something? [message #48145 is a reply to message #47734] |
Sat, 01 April 2006 01:32  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
Michael A. Miller wrote:
> Dear IDL gang,
>
> I've written some code that saves some configuration information
> by writing the IDL code needed to recreate it. For example, to
> create some object instances, I call it's IDL_code method and
> save the results to a text file. This file contains lines like
>
> foo = OBJ_NEW('my_thing', args)
> foo->set_param1, value
> foo->set_param2, another_value
>
> The idea is that I can recreate the object later on by reading
> each line in that text file and EXECUTE'ing it. I like this
> better than a save file becuase I can go and edit the saved file
> easily . But now I want to go and add multi-line commands to my
> saved file, like loops and such. Then I cannot use EXECUTE to
> execute these commands, so I'm looking at CALL_PROCEDURE. I can
> easily have my objects save a procedure, instead of a series of
> single line commands. Then when I read the file, I can find the
> procedure name and CALL_PROCEDURE on it. So my question is, is
> there a way to .compile the contents of a file from within a
> procudure or function call, so that I can CALL_PROCEDURE it?
Yes, RESOLVE_ROUTINE will do it. Specifiy the name of the routine as an
argument and RESOLVE_ROUTINE will (re)compile it.
-Mike
|
|
|