comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Automatic structure definition..
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Automatic structure definition.. [message #13632] Sun, 22 November 1998 00:00 Go to next message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
I see that IDL v 5 adds one feature that I've longed for
- automatic structure definition (automatic search for
and execution of a <structure_name>__define procedure
whenever a {<structure_name>} statement is referring
to an as yet undefined structure).

But one question: Why haven't the "builtin" structures
been built in by this method? If I do e.g.:

IDL> help,{widget_draw}
% Attempt to call undefined procedure/function: 'WIDGET_DRAW__DEFINE'.
% Structure type not defined: WIDGET_DRAW.
% Execution halted at: $MAIN$

It would make life so much simpler if RSI were to supply
such routines..... please?

Regards,

Stein Vidar
Re: Automatic Structure Definition [message #15831 is a reply to message #13632] Wed, 16 June 1999 00:00 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Daniel Peduzzi wrote:
>

> As it turns out, the problem was that I had a capital letter in my filename containing
> the structure definition procedure. Renaming it from abc_Struct__define.pro to
> abc_struct__define.pro remedied the problem, even though all references still
> contained the capital "S".

unix is case sensitive in filenames, whereas IDL is case-insensitive in
procedure names (unfortunately so ?) Perhaps it would be nice if IDL
would first try to look for a file name in exactly the spelling given
and if that fails try to locate a file in all lower case. But that might
add too much confusion ?

Martin


--

|||||||||||||||\\\\\\\\\\\\\-------------------///////////// //|||||||||||||||
Martin Schultz, DEAS, Harvard University, 29 Oxford St., Pierce 109,
Cambridge, MA 02138 phone (617) 496 8318 fax (617) 495 4551
e-mail mgs@io.harvard.edu web http://www-as/people/staff/mgs/
Re: Automatic Structure Definition [message #15834 is a reply to message #13632] Wed, 16 June 1999 00:00 Go to previous message
Daniel Peduzzi is currently offline  Daniel Peduzzi
Messages: 29
Registered: June 1999
Junior Member
J.D. Smith wrote in message <3767D7DA.31F1E6DB@astrosun.tn.cornell.edu>...
> "R.Bauer" wrote:
>>
>> Daniel Peduzzi wrote:
>>
>>> I recently spent quite a bit of time wondering why my automatic structure
>>> definition files could not be seen by IDL. All attempts to instantiate the structure
>>> in my calling program resulted in the error "attempt to call undefined procedure/function".
>>>
>>> As it turns out, the problem was that I had a capital letter in my filename containing
>>> the structure definition procedure. Renaming it from abc_Struct__define.pro to
>>> abc_struct__define.pro remedied the problem, even though all references still
>>> contained the capital "S".
>>>
>>> Has anybody else experienced this problem? Or perhaps it is not a problem
>>> at all, and I missed the explanation? This requirement is definitely not explained
>>> in the "Automatic Structure Definition" section.
>>>
>>> Dan Peduzzi
>>> peduzzi@mediaone.net
>>
>> This a problem using idl on unix.
>> IDL on windows did not distinguish lower or upper cases.
>>
>> R.Bauer
>
> It's the only reasonable solution though, since IDL is case-insensitive
> and unix file systems are case-sensitive. How is IDL to know which file
> to use? Either it adopts a given convention (e.g., all lower-case), or
> it searches for all upper-lower permutations of the given name, which,
> for abc_Struct__define.pro, includes 262144 possibilities. (Or it
> becomes case-sensitive, which is a whole different kettle of fish).
>
> A lesson learned: always use lower case for naming files containing IDL
> routines under unix.
>

I agree...adopting a lower-case convention is the way to go.

I was just feeling a little foolish that I'd spent so much time tracking down
something which, as you clearly illustrated above, is a reasonable
implementation on UNIX systems. I just wish the docs had contained
some sort of warning.

I guess I shouldn't feel TOO foolish, though, since this passage is
copied verbatim from the V.5 "Building IDL Applications" documentation
(note the capital letters):

"When IDL encounters a reference to an undefined named structure, it
will automatically search the directories specified in !PATH for a procedure
named Name__DEFINE, where Name is the actual name of the structure."

It was unclear to me that the above refers only to the name of the structure
definition procedure, and that there shouldn't be, in this case, a consistency
between the procedure name and the filename which contains it.

Like you said...lesson learned!


Dan Peduzzi
peduzzi@mediaone.net
Re: Automatic Structure Definition [message #15837 is a reply to message #13632] Wed, 16 June 1999 00:00 Go to previous message
J.D. Smith is currently offline  J.D. Smith
Messages: 214
Registered: August 1996
Senior Member
"R.Bauer" wrote:
>
> Daniel Peduzzi wrote:
>
>> I recently spent quite a bit of time wondering why my automatic structure
>> definition files could not be seen by IDL. All attempts to instantiate the structure
>> in my calling program resulted in the error "attempt to call undefined procedure/function".
>>
>> As it turns out, the problem was that I had a capital letter in my filename containing
>> the structure definition procedure. Renaming it from abc_Struct__define.pro to
>> abc_struct__define.pro remedied the problem, even though all references still
>> contained the capital "S".
>>
>> Has anybody else experienced this problem? Or perhaps it is not a problem
>> at all, and I missed the explanation? This requirement is definitely not explained
>> in the "Automatic Structure Definition" section.
>>
>> Dan Peduzzi
>> peduzzi@mediaone.net
>
> This a problem using idl on unix.
> IDL on windows did not distinguish lower or upper cases.
>
> R.Bauer

It's the only reasonable solution though, since IDL is case-insensitive
and unix file systems are case-sensitive. How is IDL to know which file
to use? Either it adopts a given convention (e.g., all lower-case), or
it searches for all upper-lower permutations of the given name, which,
for abc_Struct__define.pro, includes 262144 possibilities. (Or it
becomes case-sensitive, which is a whole different kettle of fish).

A lesson learned: always use lower case for naming files containing IDL
routines under unix.

JD

--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
Re: Automatic Structure Definition [message #15840 is a reply to message #13632] Wed, 16 June 1999 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Daniel Peduzzi wrote:

> I recently spent quite a bit of time wondering why my automatic structure
> definition files could not be seen by IDL. All attempts to instantiate the structure
> in my calling program resulted in the error "attempt to call undefined procedure/function".
>
> As it turns out, the problem was that I had a capital letter in my filename containing
> the structure definition procedure. Renaming it from abc_Struct__define.pro to
> abc_struct__define.pro remedied the problem, even though all references still
> contained the capital "S".
>
> Has anybody else experienced this problem? Or perhaps it is not a problem
> at all, and I missed the explanation? This requirement is definitely not explained
> in the "Automatic Structure Definition" section.
>
> Dan Peduzzi
> peduzzi@mediaone.net

This a problem using idl on unix.
IDL on windows did not distinguish lower or upper cases.

R.Bauer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Releasing dll's
Next Topic: DataMiner - Number of rows in a table?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:12:41 PDT 2025

Total time taken to generate the page: 0.00728 seconds