class: PrintfScanf
comment/format in:
#examples
#printf:arguments:
#scanf:fromStream:
#sscanf:fromString:
category of: #version_CVS
--- a/PrintfScanf.st Tue Aug 27 09:31:27 2013 +0200
+++ b/PrintfScanf.st Tue Aug 27 09:34:56 2013 +0200
@@ -45,9 +45,9 @@
"
self new printf:'%#x %#X %03o%*.*s' arguments: #(16rABCD 16rEF 5 9 5 ''ghijklmn'')
- self new printf:'%- 10.4s%.2e' arguments: (Array with: 'abcdefghijkl' with: Float pi)
+ self new printf:'%- 10.4s%.2e' arguments: { 'abcdefghijkl' . Float pi }
- self new printf:'%8.3f' arguments: (Array with: 200 sqrt negated)
+ self new printf:'%8.3f' arguments: { 200 sqrt negated }
self new printf:'%x' arguments: #(16r41)
self new printf:'%#x' arguments: #(16r41)
@@ -60,22 +60,17 @@
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:'%f%2s%s%s%s' fromString: '237.0 this is a test'
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'
-
-
-
'%#x %#X %03o%*.*s' printf: #(16rABCD 16rEF 5 9 5 ''ghijklmn'')
+ '%- 10.4s%.2e' printf: { 'abcdefghijkl' . Float pi }
- '%- 10.4s%.2e' printf: (Array with: 'abcdefghijkl' with: Float pi)
-
- '%8.3f' printf: (Array with: 200 sqrt negated)
+ '%8.3f' printf: { 200 sqrt negated }
'%c' printf: #(16r41)
@@ -87,19 +82,13 @@
"
! !
-!PrintfScanf class methodsFor:'others'!
-
-version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic2/PrintfScanf.st,v 1.8 2013-06-16 08:36:12 cg Exp $'
-! !
-
!PrintfScanf class methodsFor:'printing'!
printf:formatString arguments:args
"Format and print the receiver with <args> formatted in C style,
as described in the UTek manual page for printf(3)."
- ^ self new printf:formatString arguments:args
+ ^ self new printf:formatString arguments:args
!
printf:formatString on:outStream arguments: args
@@ -119,7 +108,7 @@
receiver is assumed to be a conversion control string as
specified in the UTek manual page for scanf(3)."
- ^ self new scanf:formatString fromStream:dataStream
+ ^ self new scanf:formatString fromStream:dataStream
!
sscanf:formatString fromString:aString
@@ -128,7 +117,7 @@
assumed to be a conversion control string as specified in the
UTek manual page for scanf(3)."
- ^ self new sscanf:formatString fromString:aString
+ ^ self new sscanf:formatString fromString:aString
! !
!PrintfScanf methodsFor:'helpers'!
@@ -612,6 +601,10 @@
!PrintfScanf class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/PrintfScanf.st,v 1.8 2013-06-16 08:36:12 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/PrintfScanf.st,v 1.9 2013-08-27 07:34:56 cg Exp $'
+!
+
+version_CVS
+ ^ '$Header: /cvs/stx/stx/libbasic2/PrintfScanf.st,v 1.9 2013-08-27 07:34:56 cg Exp $'
! !