Re: Function referencing/automatic defintion question. [message #35382 is a reply to message #35381] |
Fri, 30 May 2003 07:47   |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
"Robert S. Hill" wrote:
>
> Paul van Delst <paul.vandelst@noaa.gov> writes:
>> Here is the snippet of code where the weird stuff occurs (I commented
>> out the COMPILE STRICTARR statement):
>>
>> ; ---------------------------------------------
>> ; Create and allocate the coefficient structure
>> ; ---------------------------------------------
>> ; -- Create the structure
>> EmisCoeff = { EmisCoeff }
>>
>> print,routine_info(/FUNCTIONS,/SOURCE)
>> stop ;***NOTE the STOP ***
>> ; -- Allocate it
>> Result = Allocate_EmisCoeff( n_Wind_Speeds, n_Coefficients,
>> n_Channels, $
>> EmisCoeff )
>> IF ( Result NE SUCCESS ) THEN $
>> MESSAGE, 'Error allocating EmisCoeff structure', $
>> /NONAME, /NOPRINT
>
> I interject myself into this discussion with great trepidation, but...
Please...interject. This is driving me nuts (can't you tell :o)
> Isn't this a compile-time issue, rather than a run-time issue? Unless
> Allocate_EmisCoeff has been compiled already when the routine containing
> the snippet is compiled, then Allocate_EmisCoeff is going to look like a
> variable no matter what the situation is at run time.
Well, if this is true, then I throw my hands up. (In a good way :o) My bread-n-butter is
writing Fortran90/95 code so for me (via that context) compile-time and run-time mean very
specific things. To be honest -- and here I expose my ignorance -- I don't separate
compile- and run-time in IDL (at least how I understand it).
My understanding is that when I _run_ the routine containing the snippet above it gets to
the line where the structure is defined and _compiles_ all the routines in the source file
emiscoeff__define.pro. After that my assumption is that all of those emiscoeff__define.pro
contained routines are available for use in the current scope, i.e. in the routine that
calls Allocate_EmisCoeff().
If I understand you correctly, this is not the case?
And, even if it is, that doesn't explain why the use of COMPILE_OPT STRICTARR makes
everything work as I would expect. It's as if IDL treats an array reference with higher
precedence than a function call when it's given a choice.
Thanks. Your interjection is a pillow between my head and the brick wall in front of me.
:o) (I think I'm becoming compulsive-obsessive, but I just _have_ to figure this out.)
paulv
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Ph: (301)763-8000 x7748
Fax:(301)763-8545
|
|
|