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

Home » Public Forums » archive » Sorting with IDL... Please give me any suggestions!!!
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
Sorting with IDL... Please give me any suggestions!!! [message #52035] Thu, 21 December 2006 05:26
kim20026 is currently offline  kim20026
Messages: 54
Registered: November 2006
Member
I am trying to learn the sort function in IDL. I would like to sort the
final grades of my students in this semester.

Jung 75
Hyun 98
Ji 95
Young 92
Chun 88
Dong 89
Joo 87
Won 82
Du 86
Jin 84

I saved these data in 'score.txt' file. I checked the sort function in
IDL online help. The explanation was only for 1 dimensional array, but
it was not useful for me. I just made a simple code like this, but it
didn't work properly.

------------------------------------------
pro grade

nm = strarr(10)
sr = fltarr(10)
gr = [nm, sr]
file='score.txt'
openr, lun, file, /get_lun
readf, lun, gr

PRINT, 'Scores in sorted order: ', sr[SORT(sr)]
print, gr, free_lun, lun

end

--------------------------
I got a 'input conversion error' message and a blue arrow at line 8.
Please let me know what to do. Give me any suggestions. Thanks.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: How to Get Started with the Z-Buffer
Next Topic: Re: Sorting with IDL... Please give me any suggestions!!!

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

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

Total time taken to generate the page: 0.00588 seconds