Part of the Samples Website. 8/16/97.


«Discards changes to the frontmost window
on revertFrontWindow ()
local (w = window.frontMost ())
on doRevert ()
window.setModified (w, false)
if window.isModified (w) «couldn't "unmodify" window
dialog.alert ("Unable to discard changes made in this window.")
return (false)
if not dialog.confirm ("Discard changes made to "" + w + ""?")
window.setModified (w, true) «restore
return (false)
window.close (w) «discard changes (w)
return (true)
if not defined (w^)
dialog.alert ("Can't revert this window.")
return (false)
case typeOf (w^) «make sure it's a type of window that can be reverted
return (doRevert ())
dialog.alert ("Only outline, script, and wp-text windows can be reverted individually.")
return (false)

This page was last built on Sat, Aug 16, 1997 at 6:40:22 PM. You can download the current set of sample scripts from our FTP site. Dave