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

Home » Public Forums » archive » idl syntax error
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
idl syntax error [message #87944] Wed, 05 March 2014 01:37 Go to next message
Antoine Denazelle is currently offline  Antoine Denazelle
Messages: 3
Registered: March 2014
Junior Member
Hi,
I'll make it short because I guess it will not be published...
I see a strange behaviour of IDL compiler concerning keywords.
First compilation points out a syntax error for this kind of line:

my_var= my_func( a, min=b, max=c) (error shows at "=b")

second compilation on a unix system points out no error.
My program works fine, I just wonder why this behaviour. I suspect that for it to appear with no error, some other compilations are needed...
Put min and max in high case doesn't change anything. min and max are maybe not the best name choices, but to change their name doesn't change the problem. (I call them like my predecessor did... )

Thank you in advance for publishing, and answering.
Thank you anyway, this newsgroup is a precious mine of informations!

Cheers,
Antoine
Re: idl syntax error [message #87945 is a reply to message #87944] Wed, 05 March 2014 02:35 Go to previous messageGo to next message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
Le mercredi 5 mars 2014 10:37:17 UTC+1, Antoine Denazelle a écrit :
> Hi,
>
> I'll make it short because I guess it will not be published...
>
> I see a strange behaviour of IDL compiler concerning keywords.
>
> First compilation points out a syntax error for this kind of line:
>
>
>
> my_var= my_func( a, min=b, max=c) (error shows at "=b")
>
>
>
> second compilation on a unix system points out no error.
>
> My program works fine, I just wonder why this behaviour. I suspect that for it to appear with no error, some other compilations are needed...
>
> Put min and max in high case doesn't change anything. min and max are maybe not the best name choices, but to change their name doesn't change the problem. (I call them like my predecessor did... )
>
>
>
> Thank you in advance for publishing, and answering.
>
> Thank you anyway, this newsgroup is a precious mine of informations!
>
>
>
> Cheers,
>
> Antoine


You should not use IDL function names as keyword name. Please use for instance:
my_var = my_func( a, amin=b, amax=c)

alx.
Re: idl syntax error [message #87951 is a reply to message #87945] Wed, 05 March 2014 06:27 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Wednesday, March 5, 2014 3:35:01 AM UTC-7, alx wrote:
> Le mercredi 5 mars 2014 10:37:17 UTC+1, Antoine Denazelle a écrit :
>
>> Hi,
>
>>
>
>> I'll make it short because I guess it will not be published...
>
>>
>
>> I see a strange behaviour of IDL compiler concerning keywords.
>
>>
>
>> First compilation points out a syntax error for this kind of line:
>
>>
>
>>
>
>>
>
>> my_var= my_func( a, min=b, max=c) (error shows at "=b")
>
>>
>
>>
>
>>
>
>> second compilation on a unix system points out no error.
>
>>
>
>> My program works fine, I just wonder why this behaviour. I suspect that for it to appear with no error, some other compilations are needed...
>
>>
>
>> Put min and max in high case doesn't change anything. min and max are maybe not the best name choices, but to change their name doesn't change the problem. (I call them like my predecessor did... )
>
>>
>
>>
>
>>
>
>> Thank you in advance for publishing, and answering.
>
>>
>
>> Thank you anyway, this newsgroup is a precious mine of informations!
>
>>
>
>>
>
>>
>
>> Cheers,
>
>>
>
>> Antoine
>
>
>
>
>
> You should not use IDL function names as keyword name. Please use for instance:
>
> my_var = my_func( a, amin=b, amax=c)
>
>
>
> alx.

I suspect it is because my_func is not on IDL's path, so it doesn't know whether it is a function or an array with old-school parentheses. Try using "compile_opt idl2" just before your statement.

-C
Re: idl syntax error [message #87957 is a reply to message #87951] Thu, 06 March 2014 01:28 Go to previous messageGo to next message
Antoine Denazelle is currently offline  Antoine Denazelle
Messages: 3
Registered: March 2014
Junior Member
"compile_opt idl2" works perfectly here.

Thank you very much!
Re: idl syntax error [message #87958 is a reply to message #87945] Thu, 06 March 2014 01:29 Go to previous message
Antoine Denazelle is currently offline  Antoine Denazelle
Messages: 3
Registered: March 2014
Junior Member
> You should not use IDL function names as keyword name. Please use for instance:
>
> my_var = my_func( a, amin=b, amax=c)
>
>
>
> alx.

I agree, it's not a very good idea to use such keyword names.
But in this case, this doesn't change the problem.
Thank you!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL Hard Crashing
Next Topic: Run Fortran executable in IDL

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

Current Time: Wed Oct 08 15:14:34 PDT 2025

Total time taken to generate the page: 0.00634 seconds