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

Home » Public Forums » archive » reverse problem
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: reverse problem [message #46179 is a reply to message #46053] Fri, 04 November 2005 09:04 Go to previous messageGo to previous message
news.qwest.net is currently offline  news.qwest.net
Messages: 137
Registered: September 2005
Senior Member
<liamgumley@gmail.com> wrote in message
news:1131118887.329659.247860@g43g2000cwa.googlegroups.com.. .
> Bob,
>
> Is it possible that you have another file named reverse.pro somewhere
> in your IDL path? Here's one way you can find which version of
> reverse.pro is being compiled:
>
> IDL> doc_library, 'reverse'
> ----- Documentation for /Applications/rsi/idl_6.1/lib/reverse.pro -----
>
> Cheers,
> Liam.
> Practical IDL Programming
> http://www.gumley.com/


Good tip Liam. The only "reverse" function is the RSI one.

As Paolo points out, the routine is returning the keyword value,
replicated to the size of the input array. Neat!
So, it is treating reverse as a single element array, then accessing
it with the input array as an index (which exceeds the "reverse" array
size, and by IDL's default rule, it replicates the last number).

example:
IDL> x = 1

IDL> print, x(findgen(10))

1 1 1 1 1 1 1 1 1 1


But the really really strange thing is that, as I showed in my original
post,
that the problem was persistent. After running the routine, the keyword
"reverse"
escaped the local scope of the routine, and came to main level (and thus
overwriting the
reverse function at the main level). Of course, this is how keywords are
supposed to work,
but it was kind of a surprise.

Cheers,
bob
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: online help IDL 6.2
Next Topic: Printinf Latitudes & Longitudes in a MAP using IDL

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

Current Time: Sun Oct 12 06:13:05 PDT 2025

Total time taken to generate the page: 0.63905 seconds