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"
-- clear the console screen with current background color
console.clear()
console.writeln("Great, a nice black board to write on !")