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

Home » Public Forums » archive » Re: Unsupported keyword on older IDL version
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: Unsupported keyword on older IDL version [message #31636 is a reply to message #31633] Mon, 29 July 2002 13:17 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Mon, 29 Jul 2002 08:14:12 -0700, Craig Markwardt wrote:


> Paul Hick <pphick@ucsd.edu> writes:
>
>> This kind of problem must have come up in this group before, but here
>> it is anyways.
>>
>> If I call the IDL systime function with the utc keyword:
>> print, systime(/utc)
>>
>> on IDL versions older than 5.4 I get the expected 'keyword not
>> supported' error message, since, well, it's not supported, right? The
>> error message pops up when the function containing the systime call is
>> compiled, so testing e.g. !version.release before executing the systime
>> call doesn't work.
>>
>> The only solution I have come up with so far is to put the systime call
>> inside a call_function call:
>> print, call_function( 'systime', /utc)
>> This will compile (I will still need to test for !version.release
>> before actually executing the statement of course).
>
> Another possibility is to use the _EXTRA mechanism:
>
> ;; Assume EXTRA is undefined
> if double(!version.release) GE 5.4 then $
> extra = {utc: 1}
> value = systime(_EXTRA=extra)
>
> Anyway you cut it, you will need an IDL version check.

Unless you use _STRICT_EXTRA, the inheritance mechanism doesn't care if
you pass it bogus keywords... in fact, that deficiency is what prompted
the creation of _STRICT_EXTRA. Here you can use it to your advantage.

IDL> print,systime(/UTCABC)
% Keyword UTCABC not allowed in call to: SYSTIME % Execution halted at:
$MAIN$
IDL> print,systime(_EXTRA={UTCABC:1})
Mon Jul 29 13:08:09 2002
IDL> print,systime(_STRICT_EXTRA={UTCABC:1}) % Keyword UTCABC not allowed
in call to: SYSTIME % Execution halted at: $MAIN$

Unfortunately, for this case, it doesn't work, because SYSTIME went from
having none to some keywords, so in old versions of IDL (prior to the
introduction of keywords to SYSTIME), you get:

IDL> print,systime(_EXTRA={UTC:1})

print,systime(_EXTRA={UTC:1})
^
% Keyword parameters not allowed in call.

For routines with new keywords, which always had keywords, this should
work.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: how to input idl figure to MS office
Next Topic: CALL_EXTERNAL

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

Current Time: Fri Oct 10 10:43:35 PDT 2025

Total time taken to generate the page: 0.48165 seconds