Console#

Introduction#

The VEXcode 123 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 the available blocks for interacting with the console:

Below is a list of all available blocks:

print#

The print block displays text in the Console at the current row.

打印 [VEXcode] ▶

Parameters

Description

value

The text, number, or variable value to display.

expanding arrow

Expand the block to read and set cursor to next row to make the cursor move to the next row after this block.

Example

aria-description goes here#
当开始 :: hat events
[Display a message in the console.]
打印 [Hello, robot!] ▶

set print precision#

The set print precision block sets the precision formatting used for displaying numbers in the Console. This print precision will apply to all subsequently printed numbers.

设定打印精度为 [0.1 v]

Parameters

Description

precision

Sets the print precision to:

  • 1
  • 0.1
  • 0.01
  • 0.001
  • All Digits

Example

aria-description goes here#
当开始 :: hat events
[Display 1/3 with two decimals.]
设定打印精度为 [0.01 v]
打印 ([1] [math_division v] [3]) ▶

clear all rows#

The clear all rows block clears all rows from the Console.

清除所有行

Parameters

Description

This block has no parameters.

Example

aria-description goes here#
当开始 :: hat events
[Clear the console after printing.]
打印 [This will disappear...] ▶
等待 [2] 秒
清除所有行

set cursor to next row#

The set cursor to next row block moves the cursor to next row in the Console.

设定光标至下一行

Parameters

Description

This block has no parameters.

Example

aria-description goes here#
当开始 :: hat events
[Print on two rows.]
打印 [Row 1] ▶
设定光标至下一行
打印 [Row 2] ▶

set print color#

The set print color block sets the print color used for displaying text in the Console.

设定打印颜色为 [black v]

Parameters

Description

color

The color console text will be displayed in:

  • black (default)
  • red
  • green
  • blue

Example

aria-description goes here#
当开始 :: hat events
[Print text in different colors.]
打印 [Default text color] ▶
设定光标至下一行
设定打印颜色为 [红色 v]
打印 [Red text color] ▶