Re: Compilation error with code from ENVI Help [message #41939] |
Mon, 29 November 2004 19:35  |
Peter Mason
Messages: 145 Registered: June 1996
|
Senior Member |
|
|
Neil. wrote:
<...>
> ; Create the map information
> map_info = envi_map_info_create (/geographic, mc=mc1, ps=ps1)
>
> I get a compilation error on the "map_info = ......" line and I have
> no idea why. I'm quite new to programming, and slowly becoming
> acquainted with the alien logic required, but this code is copied
> directly from the examples in ENVI Help!
Hi Neil,
You have encountered a fairly rich form of alien logic here. The short of
it is that IDL decided that envi_map_info_create() is an array (not a
function), then choked on the keywords. In the words of RR: "It's a
tradition, an old charter, or something."
Try one of these to sort it out:
1] Include the statement FORWARD_FUNCTION ENVI_MAP_INFO_CREATE at the start
of your .PRO file.
2] Include the statement COMPILE_OPT STRICTARR or (even better) COMPILE_OPT
IDL2 at the start of the procedure / function that calls
envi_map_info_create. Or just make a habit of putting it at the start of
each one, to avoid the array / function ambiguity more generally.
Cheers
Peter Mason
|
|
|
|