Transcript show: ((898324234234324329) printStringBase: 150); cr.
After executing the above code, I get the following:
http://forum.world.st/file/t371379/tutu.jpg
I understand that each of those characters represents a number which in this case must be less than 150. Is there a list that Smalltalk provides to show which keyboard character represents which number ?
----- Dig, dig where you are, Down below's well. Let those that walk in darkness shout, Down below's hell. -- Sent from: http://forum.world.st/Squeak-Beginners-f107673.html
On Mon, Oct 23, 2017 at 1:58 PM, RedTigerFish chihuyu@gmail.com wrote:
Transcript show: ((898324234234324329) printStringBase: 150); cr.
After executing the above code, I get the following:
http://forum.world.st/file/t371379/tutu.jpg
I understand that each of those characters represents a number which in this case must be less than 150. Is there a list that Smalltalk provides to show which keyboard character represents which number ?
The code should give an error for any base > 36.
Right now it doesn't. If the receiver is a SmallInteger it simply uses the Unicode character "n + 55" for a digit value "n", which accidentally works for bases up to 200.
Btw, you do not need the Transcript to see the result. Simply select an expression and "print it" (via menu, or Cmd/Alt-p keyboard shortcut)
898324234234324329 printStringBase: 16 => 'C777D21AAA96569'
- Bert -
I understand. Thanks a lot for your answer.
----- Dig, dig where you are, Down below's well. Let those that walk in darkness shout, Down below's hell. -- Sent from: http://forum.world.st/Squeak-Beginners-f107673.html
beginners@lists.squeakfoundation.org