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

Home » Public Forums » archive » God save me!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: God save me! [message #87342 is a reply to message #87226] Sun, 26 January 2014 06:02 Go to previous message
zbjiang803109 is currently offline  zbjiang803109
Messages: 5
Registered: January 2014
Junior Member
在 2014年1月16日星期四UTC-3下午7时08分19秒,Heinz Stege写道:
> On Thu, 16 Jan 2014 05:58:28 -0800 (PST), ??? wrote:
>
>
>
>> Thank a lot, Heinz. Adding compile_opt idl2 works. But I wonder why sometimes the compilation passes even without the option. And later when I remove the line (compile_opt idl2) the compilation also passes.
>
>>
>
> Zhibo, it is nothing wrong with not using the compile option. However,
>
> if you allow round brackets for array indexing (i.e. no compile
>
> option), the IDL compiler or interpreter has to find out if
>
> "colorbar(...)" is a variable or a function.
>
>
>
> I have never read (or investigated) how IDL is doing this. (Because
>
> for me it is convenient, to use square brackets for arrays.) I think,
>
> IDL makes it's decision on basis of it's lists of defined variables
>
> and compiled functions. But I don't really know.
>
>
>
> You can try to find it out. Does the compilation pass without an error
>
> message, when the colorbar function is already compiled? (You can
>
> check this with "help,/routines".)
>
>
>
> If you allow round brackets for arrays, then you must not use the same
>
> name (in this case "colorbar") for a variable as well for a function.
>
> (This is meant for inside of one routine. You may use "colorbar" for a
>
> function within one routine and for a variable within another
>
> routine.)
>
>
>
> If you use the said compile option, everything is simple:
>
> "y=colorbar(...)" is a function call, and "y=colorbar[...]" is array
>
> subscripting. Note that "y=colorbar[0]" and "y=colorbar[*]" are
>
> allowed also for scalar variables.
>
>
>
> Hope this helps.
>
>
>
> Cheers, Heinz

Yes, you're right. When I use the previous option, the error message appears again. When I run .compile COLORBAR and then compile the program, it passes.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Unable to create X windows Window is iconified and has no backing store...
Next Topic: Object Field Name Conflicts

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

Current Time: Wed Oct 08 17:55:09 PDT 2025

Total time taken to generate the page: 0.00458 seconds