Richard , Nages :
Using Customer.dbf , index on FIELD->Last (column2 )
1) Ordering a dbf (using an index) and ordering a array (column) will not give the same results for equal fields when we look ar the recordnumber.
For 'Bink' we have 125 , 152 ,176 , 382 there is a subkey record number
In the array (first try ) : 152 , 176 ,382 , 125
second : 382 , 125 , 176 , 152
AT RANDOM !!!
2) When in the arraysort 'Bink' is searched to reset the browse , one from the 4 'Binks' is found (the first one in the ordered array)
This gives total wrong results when is clicked on a column as 'Married' (only .F. or .T.) . When the array is reset the first occurance from usave (.F. or .T.) is found , it has nothing to do with 'Bink" ! We have to combine this column with another to make it unique
Only with a subkey we can improve xbrowse . The results would be much better with a index on LAST + FIRST , but equal names (last+first) are still there . Search in 'Bink Gregory' gives one from the two.
For using subkeys with xbrowse see :
viewtopic.php?f=3&t=21153Saving uSave and restoring it must be changed in MySetArray
Both problems can be solved with adding a column record number (or numbering the array)
In the DBF the indexexpression seems to be LAST + STR(RECNO()) , so in the array :
oBrw:aCols[2]:bOrder := {|a|TRIM(a[2])+STR(RECNO(),6)}
I will adapt the example in
viewtopic.php?f=3&t=21153 to have a working example
Frank
This key is unique . It would also be possible to save (usave) to the recnumber (sortarray)
I