====== Sorting an object collection using a delegate ====== class Person constructor( cName as string ) self:Name := cName return public property Name as string auto end class local oPersons as List oPersons := List{} oPersons:Add( Person{ "Robert" } ) oPersons:Add( Person{ "Fabrice" } ) oPersons:Add( Person{ "Chris" } ) oPersons:Add( Person{ "Nikos" } ) oPersons:Sort( ; delegate( o1 as Person, o2 as Person ) { local nResult as int nResult := o1:Name:CompareTo( o2:Name ) return nResult } ; ) Attention: this code currently compiles only in Core dialect, not in VO dialect. But there is a shorter form that compiles also in VO dialect: oPersons:Sort( {o1 AS Person, o2 AS Person => LOCAL nResult AS INT nResult := o1:Name:CompareTo(o2:Name) RETURN nResult })