| Re: Syntax error while compiling IDL code [message #38873 is a reply to message #38869] |
Wed, 07 April 2004 22:15   |
marc schellens[1]
Messages: 183 Registered: January 2000
|
Senior Member |
|
|
Paresh wrote:
> Hello Everyone,
> When I try to compile the following .pro file using IDL 6.0, I get
> a syntax error message given below.
>
>
> ------------------------------------------------------------ --------------
> IDL> .compile approach
>
> dmazid=map_2points(elk(k),nlk(k),elz(j),nlz(j),/METERS)
> ^
> % Syntax error.
> At: /disk/151/oracle/j2ee/home/default-web-app/WEB-INF/classes/F DOIclasses/IDLCode/windmodel/GEMPLEX_04_01_04/MODULES_VM/app roach.pro,
> Line 17
> % 1 Compilation error(s) in module APPROACH.
If IDL reports a syntax error here it means it does not know
the map_2points function and thinks therefore map_2points is an array.
Make sure the map_2points function is compiled before or in the
file map_2points.pro somewhere in your idl path (!PATH system variable).
HTH,
marc
> IDL>
> ------------------------------------------------------------ ---------------
>
> ---------------------------------------------------------
> PRO APPROACH,k,elk,nlk,elz,nlz,range,zpstc
> compile_opt hidden
> on_error,1
>
> ;...preamble
> if n_params() eq 0 then begin
> print,'APPROACHX,k,elk,nlk,elz,nlz,range,zpstc'
> return&endif
>
> ;...collect zipcodes which are within range of current center
> kinc=1 & k=-kinc & nzip=n_elements(elz)
> labela: k=k+kinc & dc2zip=1000.
> if k+1 gt n_elements(elk) then return
>
> ;...build table of distances of all zipcodes from current center
> for j=0,nzip-1 do begin
>
> ;*********************************************************
> ; this is where I am getting the error message...
> dmazid=map_2points(elk(k),nlk(k),elz(j),nlz(j),/METERS)
> ;*********************************************************
>
> dc2zip=[dc2zip,1e-3*dmazid(0)] &endfor & dc2zip=dc2zip(1:*)
>
> ;...select only those zipcodes within range of the storm center
> izip=where(dc2zip le range,ict) & if ict eq 0 then goto,labela
>
> ;...for each center fix collect effected zipcodes in structure
> zpstc={index:k,jndice:izip,elz:elz(izip),nlz:nlz(izip)}
> END ;APPROACH.PRO
>
> ---------------------------------------------------------
>
> Any kind of help would be appreciated.
> I am a complete novice to IDL.
>
> Thanks!
|
|
|
|