DB_sort for Psion 3A/C/MX

Basics
This sorter writes an output file in which records are identical to the input but are in a different sequence. The input must be a database file with text fields, such as are created by the standard Psion "Data" application. Any other variety of file should be sorted by a bespoke program. In the present version (2.0) files may not have more than 2000 records.
Key Types
The basic types are alphabetic and numeric. Within alphabetic, sort may be done by last-name (the part after the last space) first. Numeric sort is appropriate where conversion to scientific notation will work for all field contents. A compromise is "+ve integer" for which alphabetic sort is applied after padding each field with leading zeros so that all of them are the same length. I had expected that this would be quicker than doing conversion to numeric and then floating-point comparisons.