If is up to me, it isn't autosort.
8.02 works fine.
I think the error is here:
METHOD SortArrayData() CLASS TXBrwColumn
local aCols
local cOrder
local nAt, nFor, nLen
local uSave, cType
aCols := ::oBrw:aCols
cOrder := ::cOrder
nLen := Len( aCols )
nAt := If( ValType( ::cSortOrder ) == 'N', ::cSortOrder, ::nArrayCol )
if Len( ::oBrw:aArrayData ) > 0
for nFor := 1 to nLen
if aCols[ nFor ]:nArrayCol != ::nArrayCol
aCols[ nFor ]:cOrder := ""
endif
next
uSave := ::oBrw:aArrayData[ ::oBrw:nArrayAt ]
if cOrder == 'A'
::oBrw:aArrayData := Asort( ::oBrw:aArrayData,,, {|x,y| ACompare( x, y, nAt, ::lCaseSensitive ) < 0 } )
::cOrder := 'D'
else
::oBrw:aArrayData := Asort( ::oBrw:aArrayData,,, {|x,y| ACompare( x, y, nAt, ::lCaseSensitive ) > 0 } )
::cOrder := 'A'
endif
::oBrw:nArrayAt := AScan( ::oBrw:aArrayData, uSave )
::oBrw:Refresh()
endif
return self
//---------------------------------------------------------------------------//
static function ACompare( x, y, nAt, lCaseSensitive )
local nRet := -1
local xVal, yVal, xType, yType
local aType := 'ULNPDCHO'
if ValType( x ) != 'A'
x := { x }
endif
xVal := If( nAt <= Len( x ), x[ nAt ], nil )
xType := ValType( xVal )
if ValType( y ) != 'A'
y := { y }
endif
yVal := If( nAt <= Len( y ), y[ nAt ], nil )
yType := ValType( yVal )
if xType == yType .and. xType $ 'CDLN'
if xType == 'C' .and. ! lCaseSensitive
xVal := Upper( xVal )
yVal := Upper( yVal )
endif
else
xVal := At( xType, aType )
yVal := At( yType, aType )
endif
nRet := If( xVal == yVal, 0, If( xVal < yVal, 1, -1 ) )
//-- xVal and yVal is always numeric 1
return nRet