安慰#

介绍#

The IQ (2nd gen) Console appears in the Monitor window and displays text output from your project. In other environments like VS Code, printf will display text on the terminal. New projects begin with the cursor at row 1.

以下是所有可用方法的列表:

操作 – 输出文本或清除控制台。

行动#

printf#

printf prints text on the screen using the current cursor position.

**注意:**直到开始新行时,文本才会发送到控制台。

Usage:
printf(value)

参数

描述

value

要打印到打印控制台的字符串(在引号中)或整数。

// Print a message to the console
printf("Hello, robot!");
printf("\n");

Clear Print Console#

By using \033[2J inside of the printf command, you can clear the entire Print Console.

Usage:
printf(“\033[2J\n”)

// Print to the console, then clear it after
// 2 seconds
printf("VEXcode");
wait(2, seconds);
printf("\033[2J\n");