Console#
Introduction#
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.
print#
The print block displays text in the console at the current row.
print [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
when started :: hat events
[Display a message in the console.]
print [Hello, robot!] ▶
set print precision#
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.
set print precision to [0.1 v]
Parameters |
Description |
|---|---|
precision |
Sets the print precision to:
|
Example
when started :: hat events
[Display 1/3 with two decimals.]
set print precision to [0.01 v]
print ([1] [math_division v] [3]) ▶
clear all rows#
The clear all rows block clears all rows from the console.
clear all rows
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
when started :: hat events
[Clear the console after printing.]
print [This will disappear...] ▶
wait [2] seconds
clear all rows
set cursor to next row#
The set cursor to next row block moves the cursor to column 1 on the next row in the console.
set cursor to next row
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
when started :: hat events
[Print on two rows.]
print [Row 1] ▶
set cursor to next row
print [Row 2] ▶
set print color#
The set print color block sets the print color used for displaying text in the console.
set print color [black v]
Parameters |
Description |
|---|---|
color |
The color console text will be displayed in:
|
Example
when started :: hat events
[Print in different colors.]
print [Default text color] ▶
set cursor to next row
set print color [red v]
print [Red text color] ▶