>In this situation the Window will close properly if the user closes through the Write event. However, if the user closes using the “X” at the top right of the window, OpenInsight will prompt “Save Changes?”. If the user selects ‘Yes’, the Close calls Write, which then calls Close again. OpenInsight will debug when Close tries to run twice.
The Solution? Just ask the window if it is closing! Use retstack to see which programs are running, if WINDOW.CLOSE is in the stack, you are already closing. The code is as follows: