Re: User functions and data name conflicts [message #26512] |
Wed, 05 September 2001 00:14 |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
David Fanning wrote:
>
> Richard Smart (smart@to.astro.it) writes:
>
>> Our system have just upgraded to a new IDL with more user
>> functions, one of these new ones is pm, and obsolete
>> procedure to print matrices, one of the structured variables I
>> have been using for the last few years also has this name
>> and I have a few 1000 lines of code using this variable in
>> various ways, now none of my code runs as the variable conflicts
>> with the function, is there any way to tell IDL to ignore this
>> particular user function or do I have to go back and change
>> my variable name?
>
> Are you sure!?
Yes I am too.
First time we got such a problem was by an upgrade
to 5.4.1.
The function file_info was added by Version 5.4.1.
Version 5.4.1 is only available on unix systems as
patch. In this version this function is undocumented.
In the next version 5.5 it is documented.
(I got a lot of fun because this changes were done one day
before I gave a lecture about some routines of our library.
A lot of examples and routines were changed in the night before
the lecture. The update was necesarry because of a bug in the license
management by floating licenses.)
In our earlier library we had a same named function which returns
a named structure too. The 5.4.1 function returns a same named structure
with different tags.
The name is defined. So you can build the file_info "object-structure"
by
a={file_info}
IDL> a={file_info}
IDL> help,a,/str
** Structure FILE_INFO, 21 tags, length=60:
NAME STRING ''
EXISTS BYTE 0
READ BYTE 0
WRITE BYTE 0
EXECUTE BYTE 0
REGULAR BYTE 0
DIRECTORY BYTE 0
BLOCK_SPECIAL BYTE 0
CHARACTER_SPECIAL BYTE = 0
NAMED_PIPE BYTE 0
SETUID BYTE 0
SETGID BYTE 0
SOCKET BYTE 0
STICKY_BIT BYTE 0
SYMLINK BYTE 0
DANGLING_SYMLINK BYTE = 0
MODE LONG 0
ATIME LONG64 0
CTIME LONG64 0
MTIME LONG64 0
SIZE LONG64 0
If it is possible to start our own routine the routine itselfs stops
by an error in the moment the structure is created because of the name
conflict.
In our case it was necessary to change the routine name and the
structure name
in all routines were it was used.
This is easy done by idlde.
First do a text search on all routines and load them into idlde.
By the replace you can select all windows and then replace your string
to another.
Then try compile each routine and store it.
I expect some more problems because normally I am using names for
routines and structures
by the meaning what the routine did. I welcome new routines by new
versions because
RSI learns by what the users are doing which routines are necessary.
I will not give stupid names to my routines because nobody else will
found and use this routines.
So there is some risk that some versions later the routine name
or structure name is used internal.
But I don't understand why patches are not documented!!
In newer documentations should be a list of the named structures too and
which changes
were done to them.
cheers
Reimar
>
> I've heard of functions being confused with variables,
> but I've never, ever heard of variables being confused
> with functions.
>
> In any case, take the darn PM function out of the
> obsolete directory if you aren't using it. Or, remove
> the obsolete directory from the path. Or, if you *have*
> to have the PM function available for someone in your
> organization, move it to a ReallyReallyObsolete subdirectory,
> and let them add that directory to their path. :-)
>
> Cheers,
>
> David
>
> --
> David W. Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438, E-mail: david@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
--
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
|
|
|
Re: User functions and data name conflicts [message #26516 is a reply to message #26512] |
Tue, 04 September 2001 18:40  |
Kristine Hensel
Messages: 26 Registered: June 1999
|
Junior Member |
|
|
David Fanning wrote:
>
> Richard Smart (smart@to.astro.it) writes:
>
>> Our system have just upgraded to a new IDL with more user
>> functions, one of these new ones is pm, and obsolete
>> procedure to print matrices, one of the structured variables I
>> have been using for the last few years also has this name
>> and I have a few 1000 lines of code using this variable in
>> various ways, now none of my code runs as the variable conflicts
>> with the function, is there any way to tell IDL to ignore this
>> particular user function or do I have to go back and change
>> my variable name?
>
> Are you sure!?
>
> I've heard of functions being confused with variables,
> but I've never, ever heard of variables being confused
> with functions.
If pm is used as an array variable, the problem could come from using
pm() instead of pm[]. In which case, the choice is between replacing
the ()'s or replacing the pm's. (I'd choose the latter.)
Kristine
|
|
|
Re: User functions and data name conflicts [message #26523 is a reply to message #26516] |
Tue, 04 September 2001 10:31  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Richard Smart (smart@to.astro.it) writes:
> Our system have just upgraded to a new IDL with more user
> functions, one of these new ones is pm, and obsolete
> procedure to print matrices, one of the structured variables I
> have been using for the last few years also has this name
> and I have a few 1000 lines of code using this variable in
> various ways, now none of my code runs as the variable conflicts
> with the function, is there any way to tell IDL to ignore this
> particular user function or do I have to go back and change
> my variable name?
Are you sure!?
I've heard of functions being confused with variables,
but I've never, ever heard of variables being confused
with functions.
In any case, take the darn PM function out of the
obsolete directory if you aren't using it. Or, remove
the obsolete directory from the path. Or, if you *have*
to have the PM function available for someone in your
organization, move it to a ReallyReallyObsolete subdirectory,
and let them add that directory to their path. :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|