Hi,
You are not writing in Roman characters so it is in fact impossible to
answer your question in my idea. First try out what are Roman characters and
tell us what you mean. For sure they are not used in the English language.
As well are it not the characters I see in this message. Everyone has his
own font settings which change the way a character is showed.
Roman characters are/were used in Latin. Probably you mean the standard
characters (26) as used in most North/West Europe languages.
Because that you don't want to hear about cultures, is your question the
same as a question like how to eat a Coke but you dont't want to hear about
drinking.
However you can reach your goal. You write as some people who comes from a
country where English is standard spoken however for sure not an
Englishman/woman.
Therefore if you don't want to use cultures convert your characters to bytes
and delete the first bit of that. Then you have real ASCII and can sort it
like that (however there are still more characters in that). If that is not
enough than filter all the bits from the byte that does not fullfil that.
Not that difficult to do, it is the same way as it was done half a century
ago.
Cor
Academia - 17 Oct 2007 17:56 GMT
Maybe I can ask it differently:
How can I find the numeric values of the various character objects that can
be in the strings I'm using. These strings come from an English US .TXT
file.
I need to find a character that has a bigger value than Thanks "z"
Thanks
> Hi,
>
[quoted text clipped - 25 lines]
>
> Cor
Cor Ligthert[MVP] - 17 Oct 2007 20:39 GMT
Academia.
Those characters are all in the ASCII characterset. You get those by first
filtering the first bit from a to a Byte converted Character.
At the moment MSDN seems down but you find probably all you need in this
search.
(Have a look at ASCII because that is converting to the characters in the
first 127 range)
http://search.msdn.microsoft.com/search/Default.aspx?brand=msdn&query=encoding+t
o+byte
Cor
Academia - 17 Oct 2007 21:09 GMT
Well then I'm confused. VS2005 help has ASCII Table of codes and { is 123
(7D) but when the ComboBox sorts the { shows up at the top of the list
instead of the bottom.
I understand that inside the code they are Unicode but don't they sort the
same as ASCII.
Do I have to do as you suggest below some how?
Thanks for the help
> Academia.
>
[quoted text clipped - 9 lines]
>
> Cor
Jack Jackson - 17 Oct 2007 23:10 GMT
By default .NET does not sort strings by ASCII values. There are
various discussions of the different string sort methods on MSDN, here
is one link:
<http://msdn2.microsoft.com/en-us/library/ms973919.aspx>
>Well then I'm confused. VS2005 help has ASCII Table of codes and { is 123
>(7D) but when the ComboBox sorts the { shows up at the top of the list
[quoted text clipped - 20 lines]
>>
>> Cor
Academia - 18 Oct 2007 01:48 GMT
I read that once. I'd have to spend sometime to understand it completely but
I don't think I need to know all that.
ASCII would do just fine for what I need.
In the site I saw how to explictly set the StringComparison value but not
kow to make the combobox use a given value.
Is there some system wide parameter I can set that would make all sorts
default to StringComparison.Ordinal (I believe that is the value I need)?
Thanks for pointing out the site, I'll spend more time studying it ,out of
curiosity, but for my application only ASCII is needed. Or maybe I should
say: only en-us is all I need - I don't understand this enough to know the
difference yet.
Thanks again
> By default .NET does not sort strings by ASCII values. There are
> various discussions of the different string sort methods on MSDN, here
[quoted text clipped - 27 lines]
>>>
>>> Cor
Academia - 18 Oct 2007 01:58 GMT
> Hi,
>
> You are not writing in Roman characters so it is in fact impossible to
> answer your question in my idea. First try out what are Roman characters
> and tell us what you mean. For sure they are not used in the English
> language.
Is "Latin characters" the correct nomenclature?
Thanks
Academia - 18 Oct 2007 02:06 GMT
> Hi,
>
> You are not writing in Roman characters so it is in fact impossible to
> answer your question in my idea. First try out what are Roman characters
> and tell us what you mean. For sure they are not used in the English
> language.
Or is this the correct reference:
Roman characters used in English and Western European languages
Cor Ligthert[MVP] - 18 Oct 2007 05:08 GMT
Academia.
I think that you are meaning as I wrote the 26 base characters in modern
western Europe languages. Although I saw that you was meaning in lower and
upercase which extend that to 52. Withouth that telling that everybody would
think that it would be only upercase characters. As you look at the bit
structure in ASCII then you can see how easily that is to filter.
By the way. England is a Western Europe country, therefore English is a
Western Europe language. (All the Western Europe languages characters are in
characterset 1252)
Cor
Academia - 20 Oct 2007 23:12 GMT
> Academia.
>
[quoted text clipped - 7 lines]
> Western Europe language. (All the Western Europe languages characters are
> in characterset 1252)
Good. Now I know the words to use if I need to ask another question.
thanks
> Cor
> I want a string of characters that will sort after all strings of
> Roman letters.
[quoted text clipped - 6 lines]
> I tried using a string starting with { because in ASCII it comes
> after the letters but that sorts before the letters.
I think you want to see the help for String.CompareOrdinal and perhaps
Array.Sort using a user-supplied IComparer.
Andrew
Academia - 17 Oct 2007 17:54 GMT
I looked at that .
Maybe I can ask it differently:
How can I find the numeric values of the various character objects that can
be in the strings I'm using. These strings come from an English US .TXT
file.
I need to find a character that has a bigger value than Thanks "z"
Thanks
>> I want a string of characters that will sort after all strings of
>> Roman letters.
[quoted text clipped - 11 lines]
>
> Andrew
I ran a little test:
For i As Integer = 0 To 255
ComboBoxQ.Items.Add("\" & ChrW(i) & "\" & i.ToString("000") & "\")
Next
Shows that the default sort places "z" last.
There is no character less that 256 that follows "z" in the default sort
method of the ComboBox.
Is there a way to have the ComboBox sort per ASCII short of using:
Implements System.Collections.IComparer?
Thanks
Armin Zingler - 18 Oct 2007 12:34 GMT
> I ran a little test:
>
[quoted text clipped - 5 lines]
>
> Shows that the default sort places "z" last.
I guess you set ComboBoxQ.sorted = True
> There is no character less that 256 that follows "z" in the default
> sort method of the ComboBox.
>
> Is there a way to have the ComboBox sort per ASCII short of using:
>
> Implements System.Collections.IComparer?
Using the Combobox probably not, but you can put the items into an array,
sort it using the comparer of your choice, then put the items into the
Combobox (while having ComboBoxQ.Sorted = False).
The link Jack provided seems to be very useful for this.
Armin
Academia - 20 Oct 2007 23:16 GMT
>> I ran a little test:
>>
[quoted text clipped - 20 lines]
>
> The link Jack provided seems to be very useful for this.
I was looking for how-to that related to the ComboBox and missed the idea of
sorting outside of it before adding the items.
Thanks
> Armin