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

Home » Public Forums » archive » bug in var_to_dt
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
bug in var_to_dt [message #12093] Fri, 26 June 1998 00:00 Go to next message
wmc is currently offline  wmc
Messages: 117
Registered: February 1995
Senior Member
There is a bug in var_to_dt (idl 5.1).

Try this:
a=var_to_dt(1980) ; Fine
a=var_to_dt([1980]) ; Fails
a=var_to_dt([1980,1981]) ; Fine

Why? Because var_to_dt "cleverly" looks to see if its input has more than one
element - if so it recursively calls itself with the individual elements. But
if it is given a one-element array as input it then uncleverly fails. The fix
is to patch the code to look at (size(yyyy))(0) to see if it is an array, I think.

- William

---
William M Connolley | wmc@bas.ac.uk | http://www.nbs.ac.uk/public/icd/wmc/
Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
Re: bug in var_to_dt [message #13206 is a reply to message #12093] Fri, 23 October 1998 00:00 Go to previous message
Kevin Ivory is currently offline  Kevin Ivory
Messages: 71
Registered: January 1997
Member
Vap User <vapuser@haifung.jpl.nasa.gov> writes:
>> IDL> print,var_to_dt([1998])
>> % Conflicting data structures: YYYY,IDLDT.

William Connolley wrote:
> Funnily enough, I found this in June & posted a fix... :-)

This bug and many others are fixed in IDL 5.1.1 (released August 1998)
Kevin
--
Kevin Ivory Tel: +49 5556 979 434
Max-Planck-Institut fuer Aeronomie Fax: +49 5556 979 240
Max-Planck-Str. 2 mailto:Kevin.Ivory@linmpi.mpg.de
D-37191 Katlenburg-Lindau, GERMANY http://www.gwdg.de/~kivory2/
Re: bug in var_to_dt [message #13214 is a reply to message #12093] Thu, 22 October 1998 00:00 Go to previous message
wmc is currently offline  wmc
Messages: 117
Registered: February 1995
Senior Member
In article fsf@haifung.jpl.nasa.gov, Vap User <vapuser@haifung.jpl.nasa.gov> writes:
> IDL> print,var_to_dt(1998)
> Works fine, but...
> IDL> print,var_to_dt([1998])
> % Conflicting data structures: YYYY,IDLDT.
> % Execution halted at: VAR_TO_DT 95 /disk3/rsi/idl/lib/var_to_dt.pro
> % $MAIN$

Funnily enough, I found this in June & posted a fix... :-)

http://www.dejanews.com/getdoc.xp?AN=366253653

-W.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Q: write to clipboard
Next Topic: Re: plotting on a draw widget

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

Current Time: Fri Oct 10 05:14:42 PDT 2025

Total time taken to generate the page: 7.19792 seconds