Thanks to those people who responded to my list posting regarding
clearing the cosmetic layer. I just thought it might be useful to
summarise the possibilities that I have come across. There seem to
me to be 3 basic options:
1. Use the following menu command: "Run Menu Command 810"
However this prompts the user to decide whether or not to discard any
unsaved edits to objects in the cosmetic layer.
2. Use some MapBasic code to delete the objects from the cosmetic layer
such as:
"select * from layerinfo(frontwindow(),0,1) into sel"
"delete from sel"
This avoids the Discard prompt at the point when the cosmetic layer is
cleared
but when a user then comes to close the mapper window they are again
prompted to
save or discard.
3. Automatically save the objects to a temporary file and then delete
that file.
This avoids any interaction with the user as long as the Interactive clause
is not
used.
"cosName = WindowInfo(FrontWindow(),WIN_INFO_TABLE)"
gets name of cosmetic layer so that it can be treated as a normal table
"aFN = TempFileName$(ApplicationDirectory$())"
creates a temporary filename in the directory that the current MBX is
running from
"Commit Table cosName As aFN Type Native"
saves the cosmetic layer to the filename
"Open Table aFN As "temp1""
you have to open the table before you can drop it
"Drop Table temp1"
Deletes the table from the hard disk
You should then be able to close the mapper window without getting the
save/discard
prompt.
Hope this is useful
Regards
Gareth
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.