Louis van Alphen wrote:
Logan, thanks for the reply. The way I use the compare function is to
basically build sorted databases and indexes. The actual order is not
important. But the important thing is that it is locale independent as
weel as the sorting on the server side at sync time should be exactly
the same. Therefore the ASCII sort is the best for this. It is definitive
in all (most) cases. However, this does not seem to be supported on the
older devices (PalmOS 3.5).
In that case, I would just supply my own function. The actual implementation
of StrCompareAscii() is pretty trivial, so I'm assuming nobody will mind
if I post the code (from the sample OS sources) for it:
Int16 StrCompareAscii(const Char* s1, const Char* s2)
{
const UInt8* p1 = (UInt8*)s1;
const UInt8* p2 = (UInt8*)s2;
UInt8 c1, c2;
while ((c1 = *p1++) == (c2 = *p2++))
{
if (!c1)
{
return(0);
}
}
return(c1 - c2);
}
Hope that helps.
- Logan
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/