Token Table window

BASin

Token Table window

The Token Table window is available from the Tools menu.

The token table.

This tool opens up a window which contains a tabbed set of pages which contain the usually hard to find characters and tokens present in the Sinclair ASCII set. You can browse these pages to find the token you want, whereupon double clicking it will send that character or token to the Editor window. Clicking once on these will show a larger version, which can be useful to distinguish between them.

The status area at the bottom of the window, below the tabs, shows which character code (CHR$ code) corresponds to the character or control code/token you are currently pointing at.

The window is laid out in three tabs:

Alpha-numerics/Graphics

This page shows three areas of characters that are available to Sinclair BASIC - the Character set, which contains all the characters from the space character through to the copyright symbol.

The token table's 'alphanumerics' page.

There is a checkbox below this area, marked "Use Chars" - this, when enabled, will instead of using the default Sinclair Character set, take the graphical representations from the memory region which is pointed to by the CHARS system variable. This allows you to see the characters as they would appear on-screen.

Control codes

This page displays the colour and cursor movement characters for you to insert into your program.

The token table's 'control codes' page.

These will be sent as "Hex chars" - small custom characters which comprise the hexadecimal equivalent of their CHR$ codes. For colour control characters, this usually entails sending two characters to the editor - the colour control code and it's parameter. For example, the code for setting the INK is number 16 - so that will be sent first, followed by the ink number from 0 to 7. The Status area, although showing the correct PRINT code for the colour controls, does not show the Editor codes needed. The correct characters will be sent though.

Keywords

This page allows you to send BASIC keywords to your program.

The token table's 'keywords' page.

Like the Control Codes, these will all send the corresponding character to the editor as a "Hex char", with the corresponding hexadecimal value. This allows you to insert the tokens for each of the BASIC's keywords into strings in your program. The advantage of this is that you get a complete word using only one byte of memory. If you elect to send a keyword outside of a string literal, then the sequence of letters that make up the keyword will be sent instead.