bug in var_to_dt [message #12093] |
Fri, 26 June 1998 00:00  |
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
|
|
|
|
|