Skip to content

Obscure commands, part 6

1 message · 2002-12-09 → 2002-12-09 · Yahoo Group era · View archive on archive.org

Participants: ekrampitzjr

Preserved from the Timex/Sinclair 2068 Yahoo Group (2001–2019), which is no longer online. Text reproduced from the archive.org archive; email addresses masked.

Messages

1. Obscure commands, part 6

ekrampitzjr · Mon, 09 Dec 2002 17:54

6.  CHR$ n  [n < 32]

This is more of a programming trick, but you may not have realized 
that using these values is possible.  Characters < 32 control various 
attribute and editing functions.  For example, CHR$ 8 is "cursor 
left" and is a handy backspace.  Try this to create the Greek letter 
theta:

5>PRINT OVER 1;"O";CHR$ 8;"-"

Try this same statement with CHR$ 6, 9, and 13.

However, color attributes, CHR$ 16-20, can be accessed directly from 
the keyboard without using this statement.  This is useful when 
printing to the screen so that you need not use separate INK and 
PAPER commands.

To change INK color: with E cursor, hold down caps shift and press 
the appropriate color key.  This inserts CHR$ 16 plus the color code.

To change PAPER color: with E cursor, simply press the appropriate 
color key.  This inserts CHR$ 17 plus the color code.

FLASH on: with E cursor, hold down caps shift and press 9 key.  FLASH 
off: same but 8 key instead.  These insert CHR$ 18 plus 1 for on or 0 
for off.

BRIGHT on: with E cursor, simply press 9 key.  BRIGHT off: same but 
with 8 key:  These insert CHR$ 19 plus 1 for on or 0 for off.

INVERSE and TRUE are directly labelled on the keyboard.  These insert 
CHR$ 20 plus 1 or 0.

When editing a programmed statement, extra clicks when moving the 
cursor within the line will tell you where such attributes have been 
inserted.  Though you can't directly see them, you may delete them 
with the DELETE key.

Indexed under

BASIC programming