Task

Show how to return more than one value from a function.




import system'routines;
import extensions;
 
extension op
{
    MinMax(ref int minVal, ref int maxVal)
    {
        var ordered := self.ascendant();
 
        minVal := ordered.FirstMember;
        maxVal := ordered.LastMember
    }
}
 
public program()
{
    var values := new int[]{4, 51, 1, -3, 3, 6, 8, 26, 2, 4};
 
    values.MinMax(ref int min, ref int max);
 
    console.printLine("Min: ",min," Max: ",max)
}