March 3, 200421 yr Newbies Hi, How can I sort items in a field. For example, 10 words are enterd into a field, how can i get those words sorted alphabetically when it comes time to print? I can't find any posts relating to this. Many thanks.
March 3, 200421 yr There is no built-in way to do this. A lot depends on how the words are delimited. Delimiting by spaces is probably not going to be much use, as you won't be able to enter word pairs or phrases. Best use commas or returns. You could copy the text to a global field then perform a scripted "ripple sort" on the string. It's been years since I did a ripple sort (that was in 1982 using Basic). I'll leave it to others to fill in the minor details.
March 3, 200421 yr Set up a self join relationship based on a unique record ID such as serial number. So, each record relates exactly to itself. Then make a value list based on this relationship using the values from the field you want to sort. Then, to sort the items, just execute a script that sets the field contents to the ValulistItems() function using that valuelist. See attached file. In this example you have to have the items delimited with carriage returns. If you want to use commas or spaces, then You will have to create an intermediate calculated field which substitutes your delimiter character with a paragraph marker. Like so: ConvertedData = Substitute(FieldtoSort, ","," SortFieldItems.fp5.zip
March 3, 200421 yr A value list will remove duplicate entries... New York London Gosford London ... will become... Gosford London New York ... which may or may not be OK.
Create an account or sign in to comment