Progress
ADM 2 Reference
destroyObject (smart.p)
Cleans up and deletes the current object procedure and its descendents, if any.
Parameters: NoneReturns: Nothing (procedure)Notes:
- Checks first to see if any object is not prepared to be destroyed (for example, if DataModified is set). This is done by publishing the named event
“
confirmExit”
, which is implemented for example indatavis.p
for visual data objects which can return FALSE if their DataModified property is set, indicating that they have unsaved changes to the current record. Because of this possible error return, application code that runs destroyObject should check ERROR–STATUS:ERROR to see whether the operation succeeded or not.- The destroyObject procedure runs removeAllLinks to delete all SmartLinks associated with this object.
- The standard ADM construct for a SmartWindow is to have the CLOSE trigger run destroyObject. Therefore the statements
APPLY CLOSE to hSmartWin
andRUN destroyObject IN hSmartWin
will normally have equivalent results. You should useAPPLY CLOSE
so as to catch any other effects of this event. For other SmartObjects,RUN destroyObject
is the recommended way to destroy the object.- All SmartContainers will PUBLISH
“
destroyObject”
to delete all the SmartObject procedures they contain, before destroying themselves.- The destroyObject procedure could be localized to add a check to do cleanup before a destroy completes, or to stop a destroy event from finishing. (See the confirmExit (containr.p) entry for the standard event procedure for doing this.)
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |