Re: Where is the right place to define new structs? [message #26509 is a reply to message #26507] |
Wed, 05 September 2001 00:58  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Olaf Stetzer wrote:
>
> Hello again,
>
> just another question:
>
> I want to implement a function for thermodynamic
> calculations I need. This function needs a parameter
> set as input and returns a parameter set as output, so
> I have to define the structs which hold these sets
> somewhere.
>
> I think that the right place is in the same .pro-file
> which holds the function but I am not sure if IDL is reading
> this definition automatically when I use the function in a
> different program. Here is an example:
>
> foo.pro:
>
> define structs...
>
> function code...
>
> bar.pro:
>
> use one of the structs, then
> call the fuction foo and pass
> the struct to the function.
>
> Thanks for your help,
>
> Olaf
>
> ps: Maybe it is the right time of buying a book on
> IDL-coding now... :-)
Dear Olaf,
IDL searches routines along its search path but it looks first
in the path were idl is in.
cd,current=current
print,current
You can define this path by idlde preferences path or startup.
We prefer the startup method.
Because it is necessary if you have a library and many users
all of them should have the same order of pathes.
You can define a function like
function my_func
struct={a:1}
return,struct
end
If this is saved in the search path it is loaded
by x=my_funct()
If you like named structure you can define them in the startup file
too.
Then you only have to call them by x={name of structure}
regards
Reimar
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
http://www.fz-juelich.de/zb/text/publikation/juel3786.html
============================================================ ======
read something about linux / windows
http://www.suse.de/de/news/hotnews/MS.html
|
|
|