安慰#
介绍#
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 all blocks:
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 pen color on console — Changes the color of printed text.
在控制台上打印#
The print on console block displays text on the console with the current pen color.
在控制台上打印 [VEXcode]▶
参数 |
描述 |
|---|---|
价值 |
要在控制台上显示的文本、数字或变量值。 |
扩大箭头 |
展开块以说并将光标设置到下一行以使光标移动到该块之后的下一行。 |
例子
当开始
[Display a message in the Console.]
在控制台上打印 [Hello, Robot!]▶
将光标设置到控制台上的下一行#
将光标设置为控制台上的下一行块将光标移动到控制台上的下一行。
在控制台上设定光标至下一行
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始
[Display two lines of text.]
在控制台上打印 [Line 1]▶
在控制台上设定光标至下一行
在控制台上打印 [Line 2]▶
清除控制台#
清除控制台块清除控制台的所有文本。
清除控制台上的所有行
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始
[Clear a console message after 2 seconds.]
在控制台上打印 [Hello, Robot!]▶
等待 [2] 秒
清除控制台上的所有行
在控制台上设置打印精度#
设置控制台打印精度 块设置了在控制台上显示数字的精度格式。此打印精度将应用于所有后续打印的数字。
在控制台上设定打印精度为 [0.1 v]
参数 |
描述 |
|---|---|
精确 |
将打印精度设置为:
|
例子
当开始
[Print 1/3 as 0.33.]
在控制台上设定打印精度为 [0.01 v]
在控制台上打印 ([1] [math_division v] [3])▶
set pen color on console#
The set pen 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 pen color to [red v] on console
范围 |
描述 |
|---|---|
颜色 |
The color to set:
|
例子
当开始
[Display a green message.]
set pen color to [green v] on console
在控制台上打印 [I am green!]▶