hcl-bot
December 11, 2003, 7:08pm
1
Hey all,
I’m using an @Sort inside a combobox to sort the list. What I didn’t realize until later is that the sorting will split the word at a “;” and a “,”.
ex. Software(MS, IBM);Candy(Snickers)
will split to:
Software(MS
IBM)
Candy(Snickers)
when it needs to go to:
Software(MS, IBM)
Candy(Snickers)
I only need it to split on a “;”, because the data is coming from a list.
Here is the formula:
@Sort (sProjectList + " " + sDescriptionList; [Ascending])
I saw there was an option for an AccentSensitive on the sort, but it didn’t change anything.
Hope this is descriptive enough. Thanks.
hcl-bot
December 11, 2003, 7:20pm
2
Subject: Formula: @Sort Question
Its a bit messy but you replace the comma prior to sorting and put it back afterwards. e.g:
tList := @ReplaceSubstring ( sProjectList + " " + sDescriptionList; “,”; “~~” );
tSortedList := @Sort (tList; [Ascending]);
tOutputList := @ReplaceSubstring ( tSortedList; “~~”; “,” );
That should work but I haven’t tested it. :o)
kj
hcl-bot
December 11, 2003, 7:43pm
3
Subject: RE: Formula: @Sort Question
Hey kj,
This formula does not work. I placed it in my formula window and ran it with no changing results. It looks good, but maybe I screwed it up. Or maybe, I need to run this beforehand. What ya think?
FIELD tList := @ReplaceSubstring ( sProjectList + " " + sDescriptionList; “,”; “~~” );
FIELD tSortedList := @Sort (tList; [Ascending]);
@ReplaceSubstring ( tSortedList; “~~”; “,” )
hcl-bot
December 11, 2003, 9:07pm
4
Subject: RE: Formula: @Sort Question
This is what I did to fix the issue.
In the queryopen section, I replaced the commas with “~~”. Then I inserted the code into the column box, and it sorted ok, and then replaced the ~~ with commas again.
FIELD tSortedList := @Sort (sProjectList + " " + sDescriptionList; [Ascending]);
@ReplaceSubstring ( tSortedList; “~~”; “,” )
I want to thank kj for his help. Tanks bra!