in reply to Probelm with priority printing (hash or by an array)

Simply strech the priority numbers so that no collisions exist anymore, so Flu=> 1, Cold => 2, Diabetes =>3.... If nobody told you in which order the Flu and Cold records should be printed, they might as well be printed ordered. Then you can simply store the names in an array and loop through the array

If the method above is not possible: Store the names in an array, but because of the collisions either use an Array of Arrays, or, if you are uncomfortable with that, concatenate names with equal priority : "Flu,Cold". The concatenated values can be extracted again with split

  • Comment on Re: Probelm with priority printing (hash or by an array)