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

Home » Public Forums » archive » Re: caldat strange behavior CALDAT, JulianDay, NULL, NULL, GetYear
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: caldat strange behavior CALDAT, JulianDay, NULL, NULL, GetYear [message #84010] Wed, 24 April 2013 13:56
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Edward Hyer writes:

> IDL> print,qqtjd,format='(C())'
> ;Mon Sep 24 21:00:00 2012
> IDL> qq=temporary(null) & qq=0; undefine NULL
> IDL> caldat,qqtjd,null,null,tyyyy;get year from TJD
> IDL> print,percentiles(tyyyy)
> ; 2014 2014 2014 2014 2014
> IDL> print,percentiles(null)
> ; 1 1 1 1 1
> IDL> caldat,qqtjd,mnull,dnull,tyyyy;get year from TJD
> IDL> print,percentiles(tyyyy)
> ; 2012 2012 2012 2012 2012
> IDL> print,percentiles(mnull)
> ; 9 9 9 9 9
> IDL> print,percentiles(dnull)
> ; 24 24 24 24 24
>
> Basically, if you give the argument NULL to both the Month and Day in CALDAT, things go very wrong. I am pretty confident this is new behavior.

I don't find it particularly hard to believe there are unintended
consequences in passing the same variable by reference into the program
as two different parameters. But, maybe I've spent longer scratching my
head and wondering what the HELL is a matter with my programs than you
have.

It does appear to be a change in behavior, at least I get different
results in IDL 7.

I would say, "Don't do it." If it doesn't confuse the program, it will
certainly confuse the person who has to read the program and sort it out
when you retire. :-)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Previous Topic: caldat strange behavior CALDAT, JulianDay, NULL, NULL, GetYear
Next Topic: Re: high quality videos with idlffvideowrite?

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

Current Time: Wed Oct 08 15:37:21 PDT 2025

Total time taken to generate the page: 0.00469 seconds