469,924 Members | 1,390 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,924 developers. It's quick & easy.

Help with Sorting Order, Please

Hello !

I wonder if any one can help me to create a cosomize sorting order (as Macro or added small program
in c++ or c# which does this work) in a Access Database contaning one table only words encoded in
ISO-8859-1

A a B b C c D d E e F f G g H h I i J j
1 2 3 4 5 6 7 8 9 10 11 12
Jh jh K k L l ll M m N n O o P p Q q R r rr S s
13 14 15 16 17 18 19 20 21 22 23 24
Sh sh T t U u V v W w X x Y y Z z
25 26 27 28 29 30 31 32 33 34

There some unique cases in this alphabet that has to be considered while sorting.

a. Letters with diacritical (, , , ). The Unicode numbers for these letters are:

I. Lower cases: ( [U+00E9], [&#233]), ( [U+00ED], [&#237]), ( [U+00DA], [&#250]), (
[U+00F9], [&#249])
II. Upper cases: ( [U+00C9], [&#201]), ( [U+00CD], [&#205]), ( [U+00DA], [&#218]), (
[U+00F9], [&#217])

b. Combined letters which have to be treated as on single letter like (Jh initial case), (jh,
non-initial case), (ll, only non-initial case), (rr, only non-initial case) (Sh initial case) and
(sh, non-initial case),

c. The positions of the letters are marked from 1 to 34 starts from top left to right. This will
help to sort the words according to Kurdish Unified Alphabet. The sorting system needs to consider
the rank of level of priority to place cases in a and b in correct alphabetic position.

Thank you Dilan

Jul 19 '05 #1
2 2881


"D. Roshani" wrote:

Hello !

I wonder if any one can help me to create a cosomize sorting order (as Macro or added small program
in c++ or c# which does this work) in a Access Database contaning one table only words encoded in
ISO-8859-1


[snip]

And why do you think the C++ people can help.
Your question is all about: How do I smuggle a custom comparison function into Access.
So I would start by asking the Access people on how to do that. But that's a different
newsgroup.

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 19 '05 #2
D. Roshani wrote:
Hello !

I wonder if any one can help me to create a cosomize sorting order (as
Macro or added small program in c++ or c# which does this work) in a
Access Database contaning one table only words encoded in ISO-8859-1

A a B b C c D d E e F f G g H h I i
J j
1 2 3 4 5 6 7 8 9 10 11 12
Jh jh K k L l ll M m N n O o P p Q q R r
rr S s
13 14 15 16 17 18 19 20 21 22 23 24
Sh sh T t U u V v W w X x Y y Z z
25 26 27 28 29 30 31 32 33 34
Is this supposed to be a table? If you're going to do this, please do
it in a monospaced font!
There some unique cases in this alphabet that has to be considered while
sorting.

a. Letters with diacritical (, , , ). The Unicode numbers for
these letters are: <snip> b. Combined letters which have to be treated as on single letter like
(Jh initial case), (jh, non-initial case), (ll, only non-initial case),
(rr, only non-initial case) (Sh initial case) and (sh, non-initial case),


Here's how I'd do it.

Define a two-dimensional array of strings or a three-dimensional array
of characters to hold the letters, something like this:

char alphabet[34][2][3] = {
{"A", "a"}, {"B", "b"},
// ...
{"Jh", "jh"}, {"K", "k"}, {"L", "l"},
{"ll", "ll"}, // no initial case form, so repeat
// lowercase form
// ...

};

Now define a comparator function similar to strcmp. Starting with the
beginning of both strings, scan your alphabet array from the end (so
that the compound letters are caught) until you find the entry that your
string begins with. If they differ, return the difference between the
letter indexes. Otherwise, move straight onto the next letter and repeat.

Now, depending on how the data you want to sort is stored, you could use
qsort or write a function to do the sorting based on your comparator
function.

HTH

Stewart.

--
My e-mail is valid but not my primary mailbox. Please keep replies on
on the 'group where everyone may benefit.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by dont bother | last post: by
3 posts views Thread by John | last post: by
3 posts views Thread by Paul T. Rong | last post: by
6 posts views Thread by Dennis Gearon | last post: by
1 post views Thread by Rahul | last post: by
9 posts views Thread by Dylan Parry | last post: by
5 posts views Thread by jrod11 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.