procedure SortBase(dbf :integer; s :string);

SortBase sets an order of records. You can sort a table by one or several fields.
The function does not change an order of records in a file. When a table is sorted then you cannot use some functions like DeleteRecord, InsertRecord.

var dbf :integer; begin dbf := OpenBase( 'filename.dbf' ); if dbf <> 0 then begin SortBase(dbf, 'NAME'); SortBase(dbf, 'FIRSTNAME,LASTNAME'); CloseBase(dbf); end; end.