GSAK (Geocaching Swiss Army Knife)
Contents - Index

SqlSort (command)

SqlSort OrderBy=<order by clause>

This command will allow you to change the sort order of the grid. Any valid SQLite "order by" clause for the caches table can by used to order the grid.  Not only can you sort ascending/descending by multiple columns but you can use functions as well. For example to sort the grid in sequence of the longest hint first to the smallest hint the code would simply be:
 

SQLSort OrderBy=Length(hints) desc


To sort by ascending by difficulty then descending by distance the code would be:
 

SQLSort OrderBy=Difficulty, Distance desc


Using the $_OrderBy system variable, also makes it quite easy to save and restore your current grid sort sequence
 

$CurrentSort = $_OrderBy
#Change our sort sequence to do some work in our desired sequence
SQLSort OrderBy=Terrain Asc, Difficulty desc

# do some work here
#....
# Now finally restore our current sort sequence
SQLSort OrderBy=$CurrentSort


Note: SQLSort is just a portal to the SQLite "Order by" clause and is not aware of any GSAK settings. What ever you "Order by" here is used verbatim and not affected by any GSAK settings (like special sort sequence for "name").


Alpha List         Category List
Copyright 2004-2019 CWE Computer Services  
Privacy Policy Contact