Luart
Comprehensive Windows framework to develop in Lua
modules > console > clear

console.clear ( [color] )

Clears the console screen (equivalent of the famous DOS command cls).

Parameters

color

An optional string indicating the color to clear the console screen with. See console.bgcolor property to list the possible colors. If the color is not provided, use the current background color.
Once the console is cleared, the function revert back to the previous background color.

Return value

The function returns nothing.

Example


local console = require "console"
-- This is how to clear the console in white
console.clear("brightwhite")
console.writeln("Great, a nice white board to write on !")