[Newbies] Is there a list that Smalltalk provides to show which keyboard character represents which number ?

Bert Freudenberg bert at freudenbergs.de
Mon Oct 23 17:45:18 UTC 2017


On Mon, Oct 23, 2017 at 1:58 PM, RedTigerFish <chihuyu at 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 -​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20171023/7e70e2ca/attachment.html>


More information about the Beginners mailing list