Yes, this is indeed a "bad way" to do it! Compared with sort(), this will be slow (20..99) yield no result and it doesn't scale well. And I guess that you would in the general case, have to read every key to find the maximum key value.
in reply to Re: Numeric sorting WITHOUT <=>
in thread Numeric sorting WITHOUT <=>