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

Home » Public Forums » archive » A strange behaviour of parameters passing
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: A strange behaviour of parameters passing [message #15694 is a reply to message #15630] Fri, 04 June 1999 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
William Daffer (vapuser@catspaw.jpl.nasa.gov) writes:

> There's nothing wrong with passing expressions, unless you want to
> change the value of the parameter inside a routine. It would be nice
> if they gave us some way of checking whether an expression, rather
> than a named variable, had been passed in. I am unaware of any such
> capability.
>
> I don't think you can call this is a bug; I think it's a feature.

While we are on the subject of passing by reference (IDL variables)
and passing by value (anything else, including expressions, system
variables, structure de-references, etc.), I should just point out
that this is *exactly* why this expression does NOT work in IDL:

FOR j=0, 10 DO Readf, lun, variable[j]

Although, I have to admit, it is an expression that every one
of us has used at least once (and many times if we come to IDL
from a FORTRAN background). People are still confused about why
it produces no error message (Answer: because it actual *works*),
and still returns no useful information.

In fact, here is a riddle Bilbo could have used with Smaug:

What works perfectly in IDL, but gives you no useful
information?

Answer: Reading into subscripted variables!

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: regular expressions
Next Topic: Re: Making MPEG Movies

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

Current Time: Sun Oct 12 13:47:46 PDT 2025

Total time taken to generate the page: 1.09885 seconds