Control Codes

See all articles from Sinc-Link v4 n3
Author(s): Barry Lindstrom
Publication: Sinc-Link
Pub Details: Sinc-Link v4 n3 (Volume 4, Issue 3)
Date: May/June 1986
Pages: 2

The 2068 has a series of control codes that can be easily used by the BASIC programmer. They are listed in the owner’s manual on pages 239 and 240, and deal with the screen display.

They can be used in two ways. First and easiest, is to use them in the CHR$ statement; to change the paper color to RED, for example, you would print CHR$17 + CHR$ 2. Notice that 17 is the character code for “PAPER CONTROL” and 2 is the number of RED (on your keyboard). You could even assign these to a string variable for convenience: Let A$ = CHR$ 17 + CHR$ 2, followed by a PRINT A$ would do the same thing.

The second way to use them is in a DEF FN statement. If I had names or some other information stored in string variables and sometimes wanted them to “FLASH” when I printed them, I would have DEF FN D$(N$) = CHR$ 18 + CHR$ 1 + N$ + CHR$ 18 + CHR$ 0 somewhere early in my program. The CHR$ 18 deals with “FLASH”; CHR$ 1 turns it on, and CHR$ 0 turns it back off again. To use it, print FN D$(“HELLO”), or what ever the message is.

If you are careful you can combine quite a few of these control codes in a string variable (or function). Just remember to turn off any functions you turned on.

The following demonstration program shows each of the control codes that can be used. Unfortunately, the “CURSOR UP” and “CURSOR DOWN” codes do not work for me. If you figure out how to use them like the others, please let me know!!

This article was reprinted from the TAS BAM Users Group newsletter KEYBOARDS VOL.4 NO.1; JAN/FEB 1986