M!Table sorting by locale?

forum.3rdparty.tools (2005-2010)
James McCall

M!Table sorting by locale?

Post by James McCall » 06 Sep 2007, 20:06

 Posted by:  James McCall 

I have a request for M!Table sorting - a parameter that allows the locale to
be specified? (as per CompareStringA( ) in Kernel32.dll).

Also a question - what locale is used for sorting at the moment,
LOCALE_USER_DEFAULT?

Thanks,
James McCall

micsto
Germany
Posts: 748
Joined: 07 Mar 2017, 16:07
Location: Germany

M!Table sorting by locale?

Post by micsto » 07 Sep 2007, 09:27

 Posted by:  Michael Stoll \(MICSTO\) 

Hi James,

that's the way M!Table compares strings:

int CMTblSortVal::CmpString( LPCTSTR lpcts1, LPCTSTR lpcts2, BOOL
bCaseInsensitive /*=FALSE*/, BOOL bStringSort /*=FALSE*/ )
{
DWORD dwCmpFlags = 0;
if ( bCaseInsensitive )
dwCmpFlags |= NORM_IGNORECASE;
if ( bStringSort )
dwCmpFlags |= SORT_STRINGSORT;

int iCmp = CompareString( LOCALE_USER_DEFAULT, dwCmpFlags, lpcts1, -1,
lpcts2, -1 );

if ( iCmp == CSTR_EQUAL )
return 0;
else if ( iCmp == CSTR_GREATER_THAN )
return 1;
else
return -1;
}

As you can see, LOCALE_USER_DEFAULT is used.

Regards
Michael

James McCall

M!Table sorting by locale?

Post by James McCall » 10 Sep 2007, 22:49

 Posted by:  James McCall 

Thanks for the detail.

Any chance of a function allowing us to specify the locale?

James

micsto
Germany
Posts: 748
Joined: 07 Mar 2017, 16:07
Location: Germany

M!Table sorting by locale?

Post by micsto » 18 Sep 2007, 08:18

 Posted by:  Michael Stoll \(MICSTO\) 

I'll add it to the TODO list.

James McCall

M!Table sorting by locale?

Post by James McCall » 20 Sep 2007, 17:58

 Posted by:  James McCall 

Michael,
Did you post a response to this? I thought I saw a header for it but now
it's gone. Maybe it got lost in the recent newsgroup file corruption, if
so, please re-post.
Thanks,
James

Return to “3rdparty.tools”

Who is online

Users browsing this forum: [Ccbot] and 0 guests