+ requestNumber
authorClaus Gittinger <cg@exept.de>
Wed, 13 Apr 2005 11:42:22 +0200
changeset 3152 6d8fe02a5fe3
parent 3151 fc183d8ff88c
child 3153 499fc16c974a
+ requestNumber
DialogBox.st
--- a/DialogBox.st	Thu Apr 07 20:08:40 2005 +0200
+++ b/DialogBox.st	Wed Apr 13 11:42:22 2005 +0200
@@ -3847,6 +3847,23 @@
     "Modified: 29.5.1996 / 14:30:05 / cg"
 !
 
+requestNumber:aString 
+    "launch a Dialog, which allows user to enter a number.
+     Return the numeric value or nil 
+     (for an invalid number or if cancel was pressed)"
+
+    |string|
+
+    string := self request:aString.
+    ^ Number readFrom:string onError:nil.
+
+    "
+     Dialog requestNumber:'Enter your Age:'      
+    "
+
+    "Created: 17.11.1995 / 09:45:21 / cg"
+!
+
 requestPassword:aString 
     "launch a Dialog, which allows user to enter something invisibly.
      Return the entered string (may be empty string) 
@@ -7980,7 +7997,7 @@
 !DialogBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.235 2005-03-30 11:52:19 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.236 2005-04-13 09:42:22 cg Exp $'
 ! !
 
 DialogBox initialize!