Go to the first, previous, next, last section, table of contents.


SORTON

Use this macro to define how to sort the records in the master database file. If this is not used the records will be written out from the database file in the order they are stored in the file (or retrieved by the SQL query). This macro can be followed by up to four field arguments (or the predefined macro can be used up to four times if only given one argument each time). The records will be sorted alphabetically on the first field given, and each sorted group (of the same value) will then be resorted on the second field given, etcetera. The BANNER macro can be used to produce a header at the start of each sorted group. The example below sorts first on the YEAR field, and then on the SURNAME field for each sorted group within this.

%%SORTON %YEAR %SURNAME

Note that sorting on boolean type data fields works as follows. A boolean field with a value of T or Y is treated as true and identical, anything else is treated as false and also identical. This supports the dBase3+ syntax for logical fields.

Note that the GPPSORTON and TEXSORTON predefined macros which the above replaces are deprecated and should not be used.


Go to the first, previous, next, last section, table of contents.