Desktop File Sorting Program
by Lee Calcraft

When run, the program adds an icon to the icon bar. Clicking Menu over the icon displays a menu containing a Quit option.

Dragging a file to the icon results in the lines in the file being sorted into alphabetical order and re-saved under its original name. As this results in the original file being deleted, care should be taken as to what files are sorted.

Lines in the input file must be separated by Linefeed characters (ASCII 10). Note that the lines are sorted according to the ASCII codes of the characters that they contain, so the case of characters is relevant. If a line contains any spaces, these are just treated as characters within a word.

The file to be sorted must contain no more than 1000 lines, each containing a maximum of 80 characters. Lines are terminated by either a Line Feed or a Carriage Return (ASCII 10 or 13). Also, the file to be sorted must have a filetype of either Text (&fff) or Data (&ffd).

The sorting is performed by SWI OS_HeapSort, described on page 819 of The RISC OS Programmer's Reference Manual. For details of possible enhancements, refer to the article in this month's magazine (RISC User, Volume 4 Issue 10 page 29).

An example file, !DeskSort.Test, is included with this application.
