added valueWithRestart
authorClaus Gittinger <cg@exept.de>
Thu, 27 Jan 2000 13:02:31 +0100
changeset 5215 888c106f3240
parent 5214 f508b6911831
child 5216 548dc9332d0e
added valueWithRestart
Block.st
--- a/Block.st	Wed Jan 26 16:55:56 2000 +0100
+++ b/Block.st	Thu Jan 27 13:02:31 2000 +0100
@@ -1241,6 +1241,24 @@
     "Modified: 18.4.1996 / 13:51:38 / cg"
 !
 
+valueWithRestart
+    |myContext restartAction|
+
+    myContext := thisContext.
+    restartAction := [ myContext restart ].
+    ^ self value:restartAction.
+
+    "
+     [:restart |
+        (self confirm:'try again ?') ifTrue:[
+            restart value.
+        ]
+     ] valueWithRestart
+    "
+
+    "Modified: / 25.1.2000 / 21:47:50 / cg"
+!
+
 whileFalse
     "evaluate the receiver while it evaluates to false (ST80 compatibility)"
 
@@ -1700,6 +1718,6 @@
 !Block class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Block.st,v 1.94 1999-11-23 12:02:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Block.st,v 1.95 2000-01-27 12:02:31 cg Exp $'
 ! !
 Block initialize!