DataSafe
The DataSafe subroutine, shown in Listing 9.3, returns True if the current data is safe. If the m_DataSet variable is Nothing, then the program has no drawing loaded so there is no data to protect and DataSafe returns True.
If m_DataSet is not Nothing, the function uses the HasChanges method to see if the data has been modified. If the data has not been modified, the data is safe and DataSafe returns True.
If there are unsaved changes, DataSafe asks the user if the program should save the changes. If the user clicks No, then the program is free to discard the changes and DataSafe returns True to indicate that the changes do not need to be saved.
If the user clicks Yes, the function calls subroutine SaveData to save the data. It then ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access