|
Post by mueh on Nov 28, 2021 13:10:20 GMT -5
George: Since 2.5 files beginning with - (minus sign) are not sorted correctly . They are sorted in order as if - is ignored . In 2.4 they are shown before first Alphabetical File name . If you don't want to change i can live with it . Thanks for 21327 .
|
|
|
Post by mueh on Nov 28, 2021 13:33:13 GMT -5
Robert: Thanks for pointing me to Windows . It shows that confusing order . I will use FM LOC -XXX cmd to find file .
|
|
|
Post by George on Nov 28, 2021 16:43:45 GMT -5
MUEH: I too got caught. I don't remember the specifics, but I spotted an 'error' recently, and then thought "Oh, I know what this is".
Yep, the MS 'logical' sort.
===> Maybe we should call it the MS 'illogical' sort? - R
Yeah, I had
AAA 01 BBB AAA 1 BBB AAA 02 BBB
and wondered why 1 came before 02. They must have an interesting sort algorithm.
|
|
|
Post by mueh on Dec 1, 2021 2:25:35 GMT -5
Georege: Many Thanks for 21334 . I just tested the Minus Sign order problem and it still exists . FMSORTSIMPLE=1 ( please do not forget to change CFGMAINT on next official release ) . I think using StrCmpIW is not solving problem . Old style sorting code in 2.5.21149 did it without windows function .
FUNCTION FMSortUp(p1 AS ASCIIZ * 512, p2 AS ASCIIZ * 512) AS LONG
'---------- Support sort of the FMFiles array
LOCAL P1Flag, P2Flag AS STRING, FTest AS LONG
P1Flag = LEFT$(p1, 4): P2Flag = LEFT$(p2, 4) ' Get a working copy of flags
FTest = FMSortFlag(P1Flag, P2Flag) ' Do test in common code
IF FTest <> 0 THEN FUNCTION = FTest:EXIT FUNCTION ' If < or > result, pass it back
IF UCASE$(MID$(p1, 5)) > UCASE$(MID$(p2, 5)) THEN FUNCTION = +1: EXIT FUNCTION
IF UCASE$(MID$(p1, 5)) < UCASE$(MID$(p2, 5)) THEN FUNCTION = -1: EXIT FUNCTION
FUNCTION = 0
END FUNCTION
I hope that ASCII to WSTRINGZ change in FMSORT... and REDIM tSort in Loaddata need no change back . Just for curiosity :+ (Plus sign x'2B') is not ignored with windows 'Logical' sort order . Could you change back to above old sort code from 21149 for FM Simple search order . (without Windows function) P.S. The numeric sorting works ( is back to old style ) .
|
|
|
Post by George on Dec 1, 2021 11:27:04 GMT -5
MUEH: I put back the old code. I can't find it now, but I remember finding a comment on MS that the routine was supposed to be a simple ANSI comparison, obviously not.
George
|
|