|GSAK (Geocaching Swiss Army Knife)|
SaveFilter() : string
This function will save all your current filter settings to a variable that can later be used by the RestoreFilter function. Only information saved to a variable by this function can be used in the RestoreFilter function otherwise you will get an error. You would normally save your current filter settings to a variable just by running the following command:
You can then use the $SavedFilter variable at any time later in the macro in the RestoreFilter command to regenerate the filter settings (and run it). To fully understand this function also study the RestoreFilter function.
This function has no parameters, but is a function because it returns a string variable.
Note: SaveFilter() does not support joined filters (the filter could be the result of many join operations). You can test to see if the current filter is the result of a join or not by using the SysInfo() function.
There is a way to effectively restore *any* filter, joined or not. However, this method has a subtle, but significant difference in the end result. This difference needs to be understood and evaluated to dertermine if it is a viable work around/solution for your intended use and audiance.
That is, you can take a snap shot of the "codes" in the current filter. When your macro code has finished its work, you can then create a filter of those "codes".
The difference now is that your filter criteria is now basically a "static" one, that just matches those codes.
Below is sample code that shows how this can be done:
Note: The FilterSave table is created in the "gsak_mem" database. This is a special "memory" database (used for speed optimization) that is automatically created and then attached to the main database at GSAK start up.
Alpha List Category List
Copyright 2004-2014 CWE Computer Services |