--- a/PrintfScanf.st Tue Jul 27 10:28:19 2004 +0200
+++ b/PrintfScanf.st Tue Jul 27 11:17:42 2004 +0200
@@ -17,13 +17,19 @@
self new printf:'%8.3f' arguments: (Array with: 200 sqrt negated)
- self new printf:'%c' arguments: #(16r41)
+ self new printf:'%c' arguments: #(16r41)
+ self new printf:'%c' arguments: #( $A )
+ self new printf:'%s' arguments: #( $A )
+ self new printf:'%s' arguments: #( 'hello' )
+ self new printf:'%4s' arguments: #( 'hello' )
+ self new printf:'%7s' arguments: #( 'hello' )
self new sscanf:'%f%2s%s%s%s' string: '237.0 this is a test'
- self new sscanf:'%d%f%s' string: '25 54.32e-01 monday'
- self new sscanf:'%f%*f %8[A-F0-9]%c%d 0x%x%f' string: '12.45 1048.73 AE40Z527 0x75BCD15 34'
+ self new sscanf:'%d%f%s' fromString: '25 54.32e-01 monday'
+
+ self new sscanf:'%f%*f %8[A-F0-9]%c%d 0x%x%f' fromString: '12.45 1048.73 AE40Z527 0x75BCD15 34'
@@ -385,7 +391,7 @@
].
^ self
].
- width := 0.
+
char := format peek.
char == $% ifTrue:[
^ dataStream peekFor:char
@@ -400,6 +406,7 @@
^ self
]
].
+ width := 0.
char isDigit ifTrue:[
width := Integer readFrom:format.
char := format peek
@@ -513,5 +520,5 @@
!PrintfScanf class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/PrintfScanf.st,v 1.1 2004-07-27 08:28:19 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/PrintfScanf.st,v 1.2 2004-07-27 09:17:42 cg Exp $'
! !