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

Home » Public Forums » archive » Re: Loop Arrays
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: Loop Arrays [message #26978 is a reply to message #26977] Tue, 09 October 2001 12:57 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ken Mankoff (mankoff@lasp.colorado.edu) writes:

> I am interested in creating circular arrays, where subscripts that would
> be out-of-bounds on a regular array just start indexing on the other side
> of the array.
>
> ex:
> a = circleIndgen( 10 )
> print, a[ -1 ]
> 9
> print, a[ 11 ]
> 1
> print, a[ [0,10,20,100] ]
> 0, 0, 0, 0
>
> print, a[ 8:11 ]
> 8, 9, 0, 1
>
> ;;; not sure if this makes sense, but i think it can easily be
> ;;; done if the rest is possible...
> print, a[ 8:2 ]
> 8, 9, 0, 1
>
> I think that overloading the [] operators is not an option from my
> understanding of IDL. Does anyone know if this is possible?

Uh, you must have dropped your notes from your C++ course
and got them mixed up with your print-outs of IDL
newsgroup articles. :-)

There isn't going to be any "overloading of operators"
in IDL, I can assure you of that.

Although you *could* create an object that could produce
the results you want when you call, for example, the
SubSet method (or whatever).

> Desirable? Dumb?

Depends entirely on what you are trying to do.
Although it does seem like an awful lot of work
to me. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@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
Previous Topic: Mac OSX
Next Topic: IDL and XML

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

Current Time: Fri Oct 10 08:41:07 PDT 2025

Total time taken to generate the page: 0.88326 seconds