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

Home » Public Forums » archive » Re: gotcha: indexing into a scalor
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
Re: gotcha: indexing into a scalor [message #7882] Sat, 18 January 1997 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Paul Ricchiazzi writes about IDL's ability to subscript scalar values:

> Is this feature carried over to latter versions of IDL?

Not only is it carried over to later versions of IDL, but I
am sure the really expert IDL programmers like Ray Sterner
and others will tell you that it has become an indespensible
component of their own programming styles. :-)

Just to give you one example, some people use it to prevent
scalar variables from being passed by reference in IDL programming
calls. (Subscripted variables are passed by value, not by
reference.) Consider this program:

PRO DOUBLE, number
number = number * 2
END

Compare the results if I do this:

IDL> a = 5
IDL> DOUBLE, a
IDL> Print, a
10

As opposed to this:

IDL> a = 5
IDL> DOUBLE, a(0)
IDL> Print, a
5

Interest has sort of fallen off for the IDL Expert Programmers
Convention (too many people holding their breath for IDL 5.0, I
hear), but this is the sort of thing that *might* have gotten you
invited. ;-)

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
2642 Bradbury Court, Fort Collins, CO 80521
Phone: 970-221-0438 Fax: 970-221-4762
E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
-----------------------------------------------------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Saving to netCDF
Next Topic: !!! NEW SITE !!! for up to date programming and computer related links

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

Current Time: Wed Oct 08 19:22:38 PDT 2025

Total time taken to generate the page: 0.00525 seconds