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

Home » Public Forums » archive » sorting string arrays - non alphabetic and user defined order
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: sorting string arrays - non alphabetic and user defined order [message #50821 is a reply to message #50654] Tue, 17 October 2006 04:43 Go to previous messageGo to previous message
greg michael is currently offline  greg michael
Messages: 163
Registered: January 2006
Senior Member
hmm... it seems to me that 'result' is the array you are looking for:
it has the elements in the order you want, and they have the indices
numbered from zero (i.e. there are no empty elements). I don't see why
you would want the dimensions of mylist or result to be the same as
namelist. mylist is given to you, and has its own size - the code will
work whatever its size; 'result' is calculated and has its own
'dynamically allocated' size.

If you're sure you want an output with blanks - although I can't see
how you would use it - try tacking this on the end:

result2=namelist
result2[where(total(s,2) eq 0)]=''

IDL> print,'#'+result2+'#'
## #Groggy# ## ## #Emmy# ## #Jockey# ## #Itchy# #Fluffy#

So you have namelist with the unneeded elements set to empty.


If I still haven't got it, perhaps you could write what you would
expect the output to look like for a couple of cases.

regards,
Greg
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: path to .sav file
Next Topic: Re: Retrieving the title of a widget_base after the fact.

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

Current Time: Thu Oct 09 19:03:20 PDT 2025

Total time taken to generate the page: 0.64099 seconds