1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-03 07:41:21 +00:00
qb64/internal/help/_CONTROLCHR.txt

50 lines
1.9 KiB
Plaintext
Raw Normal View History

2016-03-18 11:36:04 +00:00
{{DISPLAYTITLE:_CONTROLCHR}}
2017-10-10 14:55:21 +00:00
The [[_CONTROLCHR]] statement can be used to turn OFF control character attributes and allow them to be printed.
{{PageSyntax}}
2017-10-10 14:55:21 +00:00
: [[_CONTROLCHR]] {OFF|ON}
2017-10-10 14:55:21 +00:00
{{PageDescription}}
* The [[OFF]] clause allows control characters 0 to 31 to be printed and not format printing as normal text characters.
::For example: '''{{text|PRINT CHR$(13)|green}}''' 'will not move the cursor to the next line and '''{{text|PRINT CHR$(9)|green}}''' 'will not tab.
2016-03-18 11:36:04 +00:00
* The default [[ON]] statement allows [[ASCII#Control_Characters|Control Characters]] to be used as control commands where some will not print or will format prints.
2017-10-10 14:55:21 +00:00
* '''Note:''' File prints may be affected also when using Carriage Return or Line Feed/Form Feed formatting.
2021-01-04 18:45:32 +00:00
* The QB64 IDE may allow Alt + number pad character entries, but they must be inside of [[STRING]] values. Otherwise the IDE may not recognize them.
2017-10-10 14:55:21 +00:00
{{PageExamples}}
''Example:'' Printing the 255 [[ASCII]] characters in [[SCREEN]] 0 with 32 colors.
{{CodeStart}} '' ''
{{Cl|DIM}} i {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|_BYTE}}
{{Cl|WIDTH}} 40, 25
{{Cl|CLS}}
{{Cl|_CONTROLCHR}} OFF
i = 0
DO
{{Cl|PRINT}} {{Cl|CHR$}}(i);
i = i + 1
{{Cl|IF...THEN|IF}} (i {{Cl|AND (boolean)|AND}} {{Cl|&H}}F) = 0 {{Cl|THEN}} {{Cl|PRINT}}
{{Cl|LOOP}} {{Cl|WHILE}} i
{{Cl|LOCATE}} 1, 20
DO
{{Cl|COLOR}} i {{Cl|AND (boolean)|AND}} {{Cl|&H}}F {{Cl|OR (boolean)|OR}} (i {{Cl|AND (boolean)|AND}} {{Cl|&H}}80) \ {{Cl|&H}}8, (i {{Cl|AND (boolean)|AND}} {{Cl|&H}}70) \ {{Cl|&H}}10
{{Cl|PRINT}} {{Cl|CHR$}}(i);
i = i + 1
{{Cl|IF...THEN|IF}} (i {{Cl|AND (boolean)|AND}} {{Cl|&H}}F) = 0 {{Cl|THEN}} {{Cl|LOCATE}} 1 + i \ {{Cl|&H}}10, 20
{{Cl|LOOP}} {{Cl|WHILE}} i
{{Cl|END}} '' ''
{{CodeEnd}}
2017-10-10 14:55:21 +00:00
{{PageSeeAlso}}
2016-03-18 11:36:04 +00:00
* [[_CONTROLCHR (function)]]
* [[CHR$]], [[ASC]]
* [[INKEY$]], [[_KEYHIT]]
* [[ASCII]] {{text|(codes)}}
2016-03-18 11:36:04 +00:00
* [[ASCII#Control_Characters|Control Characters]]
2019-04-15 01:15:33 +00:00
{{PageNavigation}}