Velo by Example: Terminal I/O

Terminal provides console input and output. It's a native class — the most commonly used one — so it needs no include.

Create a Terminal — a native class, so no include is needed.

Terminal term = new Terminal();

print outputs text without a newline. println adds a newline.

term.print("Hello ");     # no newline
term.println("World");    # with newline

input() reads a line from the console.

term.print("Enter your name: ");
str name = term.input();
term.println("Hello, ".con(name));