( Brutus2D 1.6, 1.7 )
console.WriteLine - write a line to the console window
Description
console.WriteLine line
- line - the line to write
console.WriteLine is the Brutus 2D console object's slightly off implementation of PRINT. It doesn't quite work like PRINT but is a suitable substitute and adequate for making
text games.
Examples
Example of Use
console.Initialize
console.WriteLine "Thou Art Dead."
console.Terminate
This displays Thou Art Dead in the console window, as a BASIC programmer would expect.
Blank Line
B2D 1.7
Starting with Brutus2D 1.7, console.WriteLine can print a blank line to the screen if it is used by itself.
console.Initialize
console.WriteLine "Line 1"
console.WriteLine
console.WriteLine "Line 3"
console.Terminate
B2D 1.6
In Brutus2D 1.6, console.WriteLine required an empty string to print a blank line.
console.Initialize
console.WriteLine "Line 1"
console.WriteLine ""
console.WriteLine "Line 3"
console.Terminate
Using Variables
Variables can be used as well as literals.
dim characterName
characterName = "Zaphod"
console.Initialize
console.WriteLine characterName
console.Terminate
Using Variables and Literals
Literals and variables can be combined using the "and" symbol ( & ).
dim characterName
characterName = "Zaphod"
console.Initialize
console.WriteLine = characterName & ", the brilliant idiot."
console.Terminate
This will display Zaphod, the brilliant idiot.
tab()bing
Currently, Brutus2D lacks a tab() function. Luckily, VBScript has a space() function that works well to replace it.
console.Initialize
console.WriteLine space(4) + "'Tabbed' four spaces"
console.Terminate
Related Pages
Methods
- console.WriteTo - write to a specific location.
- console.ReadLine - the equivalent of INPUT.
- console.Initialize - start the console object.
- console.Terminate - kill the console object
- graphics.SetText - display text in graphics mode.
Tutorials
- Hello World Tutorial - the very first tutorial
- Whats Your Name Tutorial - the second tutorial