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

Home » Public Forums » archive » Re: Sort a HASH
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: Sort a HASH [message #76664] Fri, 24 June 2011 03:52 Go to previous message
Gray is currently offline  Gray
Messages: 253
Registered: February 2010
Senior Member
On Jun 24, 4:37 am, JDS <jdtsmith.nos...@yahoo.com> wrote:
> You appear to be asking why a HASH is not ordered.  Having been familiar with HASH's from other languages, I did not expect them to be ordered.  What is peculiar here, is that, without converting hashes into a more primitive data type, there is no way to order them yourselves (or rearrange them in any way, other than a loop)!  That is in stark contrast to other languages.  For example, a common idiom in Perl is:
>
> foreach key (sort keys %hash) {
>  % do something
>
> }
>
> Is there really no equivalent in IDL?

Well, I was asking why when I indexed a hash were the elements not
returned in the order I indexed them.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Connecting GPC to IDL
Next Topic: PostScript Window Size

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

Current Time: Wed Oct 08 19:43:26 PDT 2025

Total time taken to generate the page: 0.00495 seconds