Console#
Introduction#
The VEXcode IQ Console is displayed in the Monitor window within VEXcode. It allows you to display text, receive input, and format printed data in real time. Below is a list of the available blocks for interacting with the console:
print on console – Displays text at the current cursor position.
set cursor to next row on console – Moves the cursor to the next row.
clear console – Clears all text from the console.
set print precision on console – Adjusts numeric formatting for printed numbers.
set font color on console – Changes the color of printed text.
print on console#
The print on console block displays text on the console with the current font color.
在控制台上打印 [VEXcode]▶
Parameters |
Description |
---|---|
value |
The text, number, or variable value to display on the console. |
expanding arrow |
Expand the block to say and set cursor to next row and make the cursor move to the next row after this block. |
Example
当开始 :: hat events
[Display a message in the Console.]
在控制台上打印 [Hello, Robot!]▶
set cursor to next row on console#
The set cursor to next row on console block moves the cursor to the next row on the Console.
在控制台上设定光标至下一行
Parameters |
Description |
---|---|
This block has no parameters. |
Example
当开始 :: hat events
[Display two lines of text.]
在控制台上打印 [Line 1]▶
在控制台上设定光标至下一行
在控制台上打印 [Line 2]▶
clear console#
The clear console block clears the Console of all text.
clear all rows on console
Parameters |
Description |
---|---|
This block has no parameters. |
Example
当开始 :: hat events
[Clear a console message after 2 seconds.]
在控制台上打印 [Hello, Robot!]▶
等待 [2] 秒
clear all rows on console
set print precision on console#
The set print precision on console block sets the precision formatting used for displaying numbers on the Console. This print precision will apply to all subsequently printed numbers.
在控制台上设定打印精度为 [0.1 v]
Parameters |
Description |
---|---|
precision |
Sets the print precision to:
|
Example
当开始 :: hat events
[Print 1/3 as 0.33.]
在控制台上设定打印精度为 [0.01 v]
在控制台上打印 ([1] [math_division v] [3])▶
set font color on console#
The set font color on console block changes the color of text displayed on the Console. This affects all future printed text until the color is changed again.
set font color to [red v] on console
Parameter |
Description |
---|---|
color |
The color to set: |
Example
当开始 :: hat events
[Display a green message.]
set font color to [green v] on console
在控制台上打印 [I am green!]▶