<pre>on trier f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15  -- parameters f1 to f15 are fields.  put the paramCount into numberOfKeyFields  repeat with x = 1 to numberOfKeyFields    put maxCharsOfField(param(x)) into line x of maxChars  end repeat  -- fill the sortMagic field  repeat with x = 1 to the number of cds    put empty into fld "sortMagic" of cd x    repeat with y = 1 to numberOfKeyFields      put line y of maxChars into maxCharsThisField      put fld (param(y)) of cd x into curContentThisField      put the number of chars of curContentThisField into curCharsThisField      get pad(maxCharsThisField-curCharsThisField)      put curContentThisField & it after var    end repeat    put var into fld "sortMagic" of cd x    put empty into var  end repeat  --  sort by fld "sortMagic"end trier</pre>