[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Re: String sorting ?
I use SC3.3.1 and I see the following error:
ERROR: Message 'naturalCompare' not understood.
RECEIVER:
Instance of String { (15BA9830, gc=60, fmt=07, flg=10, set=01)
indexed slots [10]
0 : 1
1 : _
2 : b
3 : a
4 : s
5 : s
6 : .
7 : a
8 : i
9 : f
}
ARGS:
Instance of String { (15BA9650, gc=60, fmt=07, flg=10, set=01)
indexed slots [8]
0 : 2
1 : _
2 : s
3 : n
4 : .
5 : w
6 : a
7 : v
}
CALL STACK:
DoesNotUnderstandError:reportError 15BD5C20
arg this = <instance of DoesNotUnderstandError>
Nil:handleError 15BD4510
arg this = nil
arg error = <instance of DoesNotUnderstandError>
Thread:handleError 15BD5DD0
arg this = <instance of Thread>
arg error = <instance of DoesNotUnderstandError>
Object:throw 15BD57D0
arg this = <instance of DoesNotUnderstandError>
Object:doesNotUnderstand 15BD4FC0
arg this = "1_bass.aif"
arg selector = 'naturalCompare'
arg args = [*1]
< closed FunctionDef > 15BD51D0
arg x = "1_bass.aif"
arg y = "2_sn.wav"
< FunctionDef in Method SequenceableCollection:insertionSortRange >
(no arguments or variables)
SequenceableCollection:insertionSortRange 15AAD030
arg this = [*4]
arg function = <instance of Function>
arg left = 0
arg right = 3
var i = 1
var j = 1
var test = "2_sn.wav"
SequenceableCollection:mergeSort 15BD5290
arg this = [*4]
arg function = <instance of Function>
var tempArray = [*4]
Interpreter:interpretPrintCmdLine 1558CEC0
arg this = <instance of Interpreter>
var res = nil
var func = <instance of Function>
var code = "["1_bass.aif", "2_sn.wav", "..."
var doc = <instance of CocoaDocument>
Process:interpretPrintCmdLine 15BD4CC0
arg this = <instance of Main>
On Sun, Dec 27, 2009 at 9:17 PM, Fredrik Olofsson <f@xxxxxxxxxxxxxxxxxxx> wrote:
> scott wrote something to do that a while ago.
> https://listarc.bham.ac.uk/lists/sc-users/msg53025.html
>
> example:
> ["1_bass.aif", "2_sn.wav", "10_file.wav", "11_etc.aif"].sort{|x, y|
> x.naturalCompare(y)<0}
>
>
> i can't reproduce your document backwards sorting problem. which sc version
> are you using? i'm on the latest svn checkout and i also tested with 3.3.1.
> _f
>
> 27 dec 2009 kl. 20.58 skrev Hjalte Møller:
>
>> sorry to answer my own post, but I forgot one thing...
>>
>> When a bunch of files is dragged 'n' dropped to a Document window, the
>> files get sorted backwards ?
>>
>>
>> 2009/12/27 Hjalte Møller <spleef.sc@xxxxxxxxx>
>> Hello list,
>>
>> Is there any way to sort strings according to how they are sorted by the
>> OS ?
>>
>> If you have a list of files like
>>
>> 1_bass.aif
>> 2_sn.wav
>> ...
>> 10_file.wav
>> 11_etc.aif
>>
>> and collect them in an array, and sort them, you get
>>
>> 1_
>> 10_
>> 11_
>> 2_
>>
>> I know that is correct behavior, but it would be nice to be able to sort
>> like osx does.
>>
>> Best, Hjalte
>>
>
>
> #|
> fredrikolofsson.com klippav.org musicalfieldsforever.com
> |#
>
>
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.):
> http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> archive: https://listarc.bham.ac.uk/marchives/sc-users/
> search: https://listarc.bham.ac.uk/lists/sc-users/search/
>
--
고 병량 (高 秉良)
PyoungRyang Ko
Tarostrasse 16 / Zi. 466 (0.414)
04103 Leipzig
Germany
Tel.
Cell. (Homezone) : ++49 - 341 -260 2869
Cell. (away): ++49 - 176 - 4002 4936
E-Mail:
pyoungryang.ko@xxxxxxxxxxxxxx
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/