The easiest way to sort values in a database is to use the database engine's sort capability. Put each value in a different related record and display them in a portal. The portal or the portal's underlying relationship can specify a sort order that lists the largest value first.
Is there not a way to sort the three variables as they are each a number within the script?
Inside a script, you must program your own SORT. Use a series of IF's
If A>B flip them using a temporary variable.
If B>C flip…. etc.
For exactly three values:
Let ( [ First = Max ( $Var1 ; $Var2 ; $Var3 ) ;
Last = Min ( $Var1 ; $Var2 ; $Var3 ) ;
Mid = case ( First = $Var1 ; Max ( $Var2 ; $Var3 ) ;
First = $Var2 ; Max ( $Var1 ; $Var3 ) ;
Max ( $Var1 ; $Var3 )
List ( First ; Mid ; Last )
) // let
as it will always be three values