David,
Before terminating the app, could you include some code to clear the cosmetic layer? You'd just need to find the name of the cosmetic layer for each map window and then use RollBack Table:
For x=1 to NumWindows()
If WindowInfo(x, WIN_INFO_TYPE) = WIN_MAPPER Then
sCosName = WindowInfo(x, WIN_INFO_TABLE)
RollBack Table sCosName
end If
Next
You could also test to see if any tables had outstanding edits that need to be saved:
For x=1 to NumTables()
If TableInfo(x, TAB_INFO_EDITED) Then ' true so save edits
Commit Table TableInfo(x, TAB_INFO_NAME)
End If
Next
You can then issue a 'close all' knowing that any cosmetic layers are empty and all edits have been saved.
There's also an option under Options -> Preferences -> Map Window - Edit where you have 3 options to 'warn prior to loss of:', one of which is the cosmetic layer. If this is unchecked and you issue a 'close all', then any objects on the cosmetic layer will not be saved, though I'm not sure if you can check/uncheck this via MapBasic.
HTH
Greg Driver
System Administrator
Applications Support
ICT
Surrey Police
NOT PROTECTIVELY MARKED
Information about this E-mail
This email and any files or attachments with it are intended solely for the use of the individual(s) or organisation(s) to whom it is addressed.
It may contain information that is confidential or subject to legal and/or professional privilege.
If you have received this email in error please notify the sender and delete it including any files or attachments from your e-mail account or computer.
Any opinions expressed in this email are those of the individual and not necessarily those of Surrey Police.
Surrey Police monitor incoming and outgoing e-mail.