From QB64 Wiki

Jump to: navigation, search

The _CONTROLCHR metacommand can be used to turn OFF control character attributes and allow them to be printed.




  • Keyword must be used with OFF or ON(default) if previously turned OFF.


  • The OFF statement allows control characters 0 to 31 to be printed or used as normal text characters.
  • The default ON statement allows control characters to be used as control commands. Some characters will not print.
  • If the command is never used in a QB64 program, control characters may format text or not print.
  • Note: File prints may be affected also when using Carriage Return or Line Feed/Form Feed formatting!

Example: Printing the 255 ASCII characters in SCREEN 0 with 32 colors.

DIM i AS _UNSIGNED _BYTE WIDTH 40, 25 CLS _CONTROLCHR OFF i = 0 DO PRINT CHR$(i); i = i + 1 IF (i AND &HF) = 0 THEN PRINT LOOP WHILE i LOCATE 1, 20 DO COLOR i AND &HF OR (i AND &H80) \ &H8, (i AND &H70) \ &H10 PRINT CHR$(i); i = i + 1 IF (i AND &HF) = 0 THEN LOCATE 1 + i \ &H10, 20 LOOP WHILE i END

See also:

Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page
  • Page
  • Discussion
  • View source
  • History
Personal tools
  • Log in