安慰#
介绍#
The VEXcode GO Console is displayed in the Monitor window within VEXcode. It allows you to display text and format printed data in real time.
Below is a list of all blocks:
print — Prints a value or text to the console.
set print precision — Sets how many decimal places to show.
clear all rows — Clears all rows in the console.
set cursor to next row — Moves the cursor to the next row.
set print color — Sets the color used for text.
ask and wait & answer — Prompts the user for input, then waits for a response to be entered in the console. The input can be used in the project.
打印#
The print block displays text in the console at the current row.
打印 [VEXcode] ▶
参数 |
描述 |
|---|---|
价值 |
要显示的文本、数字或变量值。 |
扩大箭头 |
展开块以读取并将光标设置到下一行,以使光标移动到该块之后的下一行。 |
例子
当开始 :: hat events
[Display a message in the console.]
打印 [Hello, robot!] ▶
设置打印精度#
The set print precision block sets the number of decimal places shown when displaying numbers in the console. This print precision will apply to all subsequently printed numbers.
设定打印精度为 [0.1 v]
参数 |
描述 |
|---|---|
精确 |
将打印精度设置为:
|
例子
当开始 :: hat events
[Display 1/3 with two decimals.]
设定打印精度为 [0.01 v]
打印 ([1] [math_division v] [3]) ▶
清除所有行#
The clear all rows block clears all rows from the console.
清除所有行
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始 :: hat events
[Clear the console after printing.]
打印 [This will disappear...] ▶
等待 [2] 秒
清除所有行
将光标设置到下一行#
The set cursor to next row block moves the cursor to column 1 on the next row in the console.
设定光标至下一行
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始 :: hat events
[Print on two rows.]
打印 [Row 1] ▶
设定光标至下一行
打印 [Row 2] ▶
设置打印颜色#
The set print color block sets the print color used for displaying text in the console.
设定打印颜色为 [black v]
参数 |
描述 |
|---|---|
颜色 |
彩色控制台文本将显示为:
|
例子
当开始 :: hat events
[Print in different colors.]
打印 [Default text color] ▶
设定光标至下一行
设定打印颜色为 [红色 v]
打印 [Red text color] ▶
ask and wait & answer#
The ask and wait and answer blocks are used together to prompt for an input from the console and then use the input in a project.
询问 [What's your name?] 并等待
Parameter |
描述 |
|---|---|
prompt |
The prompt to display in the console. |
应答
The answer block has no parameters.
例子
当开始
[Tell the robot your name.]
询问 [I'm GO. What's your name?] 并等待
在控制台上打印 (应答)▶