1547 "return a string to display the receiver. |
1543 "return a string to display the receiver. |
1548 The output radix is usually 10, but can be changed by setting |
1544 The output radix is usually 10, but can be changed by setting |
1549 DefaultDisplayRadix (see Integer>>displayRadix:)" |
1545 DefaultDisplayRadix (see Integer>>displayRadix:)" |
1550 |
1546 |
1551 "/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
1547 "/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
1552 "/ ST/X (and some old ST80's) mean: draw-yourself on a GC. |
1548 "/ old ST80 means: draw-yourself on a GC. |
1553 (aGCOrStream isStream) ifFalse:[ |
1549 (aGCOrStream isStream) ifFalse:[ |
1554 ^ super displayOn:aGCOrStream |
1550 ^ super displayOn:aGCOrStream |
1555 ]. |
1551 ]. |
1556 |
1552 |
1557 (DefaultDisplayRadix isNil or:[DefaultDisplayRadix == 10]) ifTrue:[ |
1553 (DefaultDisplayRadix isNil or:[DefaultDisplayRadix == 10]) ifTrue:[ |
1558 self printOn:aGCOrStream |
1554 self printOn:aGCOrStream |
1559 ] ifFalse:[ |
1555 ] ifFalse:[ |
1560 self printOn:aGCOrStream base:DefaultDisplayRadix showRadix:true. |
1556 self printOn:aGCOrStream base:DefaultDisplayRadix showRadix:true. |
1561 ]. |
1557 ]. |
1562 |
1558 |
1563 " |
1559 " |
1564 Integer displayRadix:16. 12345 |
1560 Integer displayRadix:16. 12345 |
1565 Integer displayRadix:2. 12345 |
1561 Integer displayRadix:2. 12345 |
1566 Integer displayRadix:10. 12345 |
1562 Integer displayRadix:10. 12345 |
1567 " |
1563 " |
|
1564 |
|
1565 "Modified (comment): / 22-02-2017 / 16:52:16 / cg" |
1568 ! |
1566 ! |
1569 |
1567 |
1570 printOn:aStream |
1568 printOn:aStream |
1571 "append a printed description of the receiver to aStream" |
1569 "append a printed description of the receiver to aStream" |
1572 |
1570 |