Dumb Sort Question

David C. Tremmel David.Tremmel at duke.edu
Thu Dec 13 10:37:00 EST 2001


Greg -

While not an elegant sort solution, you could do something like this 
(I'm assuming you want a list of grade frequencies as your end 
result):

gradeLevels = "A+,A,A-,B+,..."

repeat for each item X in gradeLevels
   put return & freqArray[X] after gradeFreqs
end repeat


Hope this helps...

Regards,
Dave Tremmel


>Hi Everyone,
>
>      I've created a neat little function that calculates stats and a
>distribution for test grades very quickly.  To create a frequency
>distribution of letter grades (how many A's, B's, C's, and so on), I use
>an associative array where the keys are A+, A, A-, B+, B, B-, ..., F, and
>I just plunk number grades into each element according to my conversion
>criteria.
>
>      My problem is that when I put the keys into a variable, say, Distn,
>and sort it, it comes out as
>
>      A
>      A+
>      A-
>
>      rather than
>
>      A+
>      A
>      A-
>
>      which still represents the correct frquencies but is not convenient
>to read.  Is there a handy trick to sorting Distn to get the order I
>want?  I've tried to precede each key by a number ( 1  A+,  2 A, 3  A-,
>...) and sort it, but I get gobbledeegoop.
>
>      Regards,
>
>           Greg
>
>
>
>____________________________________________________________
>Gregory Lypny
>Associate Professor
>Concordia University
>____________________________________________________________
>"They had the best selection,
>  The were poisoned by protection,
>  There was nothing that they needed,
>  They had nothing left to find."
>    - Neil Young
>
>
>E-mail forum:   markets at concordia.ca
>Visit Pareto at http://rubbersoul.concordia.ca
>Visit Borsa at http://rubbersoul.concordia.ca/Borsa_Classroom
>Crash site for notes and quizzes at
>http://homepage.mac.com/gregorylypny/FileSharing1.html
>
>
>_______________________________________________
>metacard mailing list
>metacard at lists.runrev.com
>http://lists.runrev.com/mailman/listinfo/metacard


-- 
David Tremmel
Assistant Director, National Phytotron

Duke University
Phytotron Bldg.			Phone:  (919) 660-7415
Box 90340			FAX:    (919) 660-7425
Durham, NC  27708-0340		E-mail: david.tremmel at duke.edu



More information about the metacard mailing list