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

Home » Public Forums » archive » Re: compilation strangeness
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: compilation strangeness [message #80838 is a reply to message #80827] Thu, 12 July 2012 17:21 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Jul 12, 9:03 pm, Stewart Allen <scral...@gmail.com> wrote:
>     calcstats = stats(rim,sim,arrival=1,tol=(run_no ge 7?0.01:1))
>                                       ^
> % Syntax error.
>   At: /home/data/BH/timeseries.pro, Line 41
> % 1 Compilation error(s) in module TS.
> IDL> .compile stats
> % Compiled module: STATS.
> IDL> .compile timeseries
> % Compiled module: TIMESERIES.
>
> As you can see, I'm forced to explicitly compile stats, even though I'm fairly sure IDL ought to find it and automatically compile it with timeseries.
>
> Can anyone explain what's going on? And what am I doing wrong?

When that call to stats is first encountered, if stats was not
previously compiled, IDL is assuming it is not a function, it is an
array indexed with parentheses. In array indices there cannot be an
equal sign, which is the syntax error. If you compile stats, then IDL
knows there is a function called stats, and interprets that line as a
funcion call.

If you only use square brackets for array indexing inside the code for
timeseries (as you should), you can solve that by adding

compile_opt strictarr

(or "compile_opt idl2", which also changes the default integer to 32
bit)

to the beginning of the timeseries procedure. This will make only
square brackets allowed for array indexing, so parentheses will always
mean function calls.
[Message index]
 
Read Message
Read Message
Previous Topic: Array Integration
Next Topic: read a coordinates of atmospheric air masses for plotting later on a map

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

Current Time: Fri Oct 10 01:37:38 PDT 2025

Total time taken to generate the page: 0.72248 seconds