# Strcomp with collation

**URL:** <https://forum.xojo.com/t/strcomp-with-collation/21459>\
**Category:** Windows\
**Created:** [January 8, 2015, 10:15am UTC](https://forum.xojo.com/t/strcomp-with-collation/21459 "2015-01-08T10:15:48Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alejandro\_Fresno\_Meyer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/7c8e57/32.png) [@Alejandro\_Fresno\_Meyer](https://forum.xojo.com/u/Alejandro_Fresno_Meyer)\
**Post date:** [January 8, 2015, 10:15am UTC](https://forum.xojo.com/t/strcomp-with-collation/21459/1 "2015-01-08T10:15:48Z")

</div>

I’m looking for a string comparison function with collation, is there any function or plugin available ?

Mainly for Windows as I have solved Mac with OS calls.

Thanks.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [January 8, 2015, 1:51pm UTC](https://forum.xojo.com/t/strcomp-with-collation/21459/2 "2015-01-08T13:51:56Z")

</div>

what collation?

---

<div class="post-metadata">

**Author:** ![Alejandro\_Fresno\_Meyer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/7c8e57/32.png) [@Alejandro\_Fresno\_Meyer](https://forum.xojo.com/u/Alejandro_Fresno_Meyer)\
**Post date:** [January 8, 2015, 2:04pm UTC](https://forum.xojo.com/t/strcomp-with-collation/21459/3 "2015-01-08T14:04:52Z")

</div>

Depends on user; I would set the locale before, something like strcoll in C++

---

<div class="post-metadata">

**Author:** ![John\_Hansen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@John\_Hansen](https://forum.xojo.com/u/John_Hansen)\
**Post date:** [January 8, 2015, 2:13pm UTC](https://forum.xojo.com/t/strcomp-with-collation/21459/4 "2015-01-08T14:13:11Z")

</div>

Can’t you add your text into an array and use the sort method ( [http://documentation.xojo.com/index.php/Sort](http://documentation.xojo.com/index.php/Sort))

---

<div class="post-metadata">

**Author:** ![Alejandro\_Fresno\_Meyer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/7c8e57/32.png) [@Alejandro\_Fresno\_Meyer](https://forum.xojo.com/u/Alejandro_Fresno_Meyer)\
**Post date:** [January 8, 2015, 2:17pm UTC](https://forum.xojo.com/t/strcomp-with-collation/21459/5 "2015-01-08T14:17:58Z")

</div>

John, no, I can’t. Sometimes the strings to sort are filenames, others part of dictionary arrays.

And not sure if sort, like Strcomp, cares for different cultures.

---

<div class="post-metadata">

**Author:** ![John\_Hansen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@John\_Hansen](https://forum.xojo.com/u/John_Hansen)\
**Post date:** [January 8, 2015, 2:28pm UTC](https://forum.xojo.com/t/strcomp-with-collation/21459/6 "2015-01-08T14:28:10Z")

</div>

Hmm…

Maybe a work around by using SQLite (XOJO SQLiteDatabase) for that. Might also be faster…[https://www.sqlite.org/datatype3.html#collation](https://www.sqlite.org/datatype3.html#collation)… If that what you need.

---

<div class="post-metadata">

**Author:** ![Paul\_Lefebvre](https://forum.xojo.com/user_avatar/forum.xojo.com/paul_lefebvre/32/3152_2.png) [@Paul\_Lefebvre](https://forum.xojo.com/u/Paul_Lefebvre)\
**Post date:** [January 8, 2015, 3:22pm UTC](https://forum.xojo.com/t/strcomp-with-collation/21459/7 "2015-01-08T15:22:05Z")

</div>

The new [Text](http://xojo.helpdocsonline.com/text%24Compare) type has a compare method that allows you to specify the locale. Perhaps that would work better for you?

[http://xojo.helpdocsonline.com/text$Compare](http://xojo.helpdocsonline.com/text%24Compare)

---

<div class="post-metadata">

**Author:** ![Alejandro\_Fresno\_Meyer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/7c8e57/32.png) [@Alejandro\_Fresno\_Meyer](https://forum.xojo.com/u/Alejandro_Fresno_Meyer)\
**Post date:** [January 8, 2015, 4:00pm UTC](https://forum.xojo.com/t/strcomp-with-collation/21459/8 "2015-01-08T16:00:41Z")

</div>

Paul, that is what I’m looking for ( already a long time ago).

I understand this type is available with last version, mmm … will have to update

---

<div class="post-metadata">

**Author:** ![John\_Hansen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@John\_Hansen](https://forum.xojo.com/u/John_Hansen)\
**Post date:** [January 8, 2015, 4:13pm UTC](https://forum.xojo.com/t/strcomp-with-collation/21459/9 "2015-01-08T16:13:51Z")

</div>

[quote=158056:@Paul Lefebvre]The new [Text](http://xojo.helpdocsonline.com/text%24Compare) type has a compare method that allows you to specify the locale. Perhaps that would work better for you?

[http://xojo.helpdocsonline.com/text$Compare[/quote]](http://xojo.helpdocsonline.com/text%24Compare%5B/quote%5D)

But is this supported for windows yet ?

---

<div class="post-metadata">

**Author:** ![Travis\_Hill](https://forum.xojo.com/user_avatar/forum.xojo.com/travis_hill/32/3_2.png) [@Travis\_Hill](https://forum.xojo.com/u/Travis_Hill)\
**Post date:** [January 8, 2015, 4:36pm UTC](https://forum.xojo.com/t/strcomp-with-collation/21459/10 "2015-01-08T16:36:21Z")

</div>

> [@158073:@John Hansen](#):
>
> But is this supported for windows yet ?

Yes.

---

<div class="post-metadata">

**Author:** ![Paul\_Lefebvre](https://forum.xojo.com/user_avatar/forum.xojo.com/paul_lefebvre/32/3152_2.png) [@Paul\_Lefebvre](https://forum.xojo.com/u/Paul_Lefebvre)\
**Post date:** [January 8, 2015, 6:50pm UTC](https://forum.xojo.com/t/strcomp-with-collation/21459/11 "2015-01-08T18:50:11Z")

</div>

> [@158073:@John Hansen](#):
>
> But is this supported for windows yet ?

The Text data type is available for all project types. More information on what else is available for all project types in 2014r3 is here:

[http://www.xojo.com/blog/en/2014/12/new-language-features.php](http://www.xojo.com/blog/en/2014/12/new-language-features.php)

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:33pm UTC](https://forum.xojo.com/t/strcomp-with-collation/21459/12 "2020-10-29T17:33:59Z")

</div>


