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 – 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.
imprimir [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
cuando empezó :: hat events
[Display a message in the console.]
imprimir [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.
establecer la precisión de impresión a [0.1 v]
Parameters |
Description |
|---|---|
precision |
Sets the print precision to:
|
Example
cuando empezó :: hat events
[Display 1/3 with two decimals.]
establecer la precisión de impresión a [0.01 v]
imprimir ([1] [math_division v] [3]) ▶
clear all rows#
The clear all rows block clears all rows from the Console.
borrar todas las filas
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
cuando empezó :: hat events
[Clear the console after printing.]
imprimir [This will disappear...] ▶
esperar [2] segundos
borrar todas las filas
set cursor to next row#
The set cursor to next row block moves the cursor to next row in the Console.
colocar el cursor en la siguiente fila
Parameters |
Description |
|---|---|
This block has no parameters. |
Example
cuando empezó :: hat events
[Print on two rows.]
imprimir [Row 1] ▶
colocar el cursor en la siguiente fila
imprimir [Row 2] ▶
set print color#
The set print color block sets the print color used for displaying text in the Console.
establecer color de impresión [negro v]
Parameters |
Description |
|---|---|
color |
The color console text will be displayed in:
|
Example
cuando empezó :: hat events
[Print text in different colors.]
imprimir [Default text color] ▶
colocar el cursor en la siguiente fila
establecer color de impresión [rojo v]
imprimir [Red text color] ▶