$SavedFilter = SaveFilter() |
# Save the codes in our current filter to a sqldatabase in memory $status = Sqlite("sql","drop table if exists gsak_mem.FilterSave") $status = Sqlite("sql","create table gsak_mem.FilterSave as select code from caches where rowid in (select * from gridtemp)") # cancel the current filter to work on the whole database cancelfilter msgok msg="Filter now cancelled" # You would now execute your main macro code here GoSub Name=DoSomething # Now we need to restore our filter of codes # First get our list of saved codes via sql $codes = sqlite("sql","select * from gsak_mem.FilterSave") # clear out all macro flags macroflag type=clear range=all # Now match these codes and set the macroflag $number = codematch($codes,$_NewLine,"M") # Now set a filter of our matched codes by filtering on macroflag Mfilter where=$d_Macroflag BeginSub Name=DoSomething # macro code here EndSub |