Console: WriteLine |
Writes a value to the current output stream.
Public Sub WriteLine( ParamArray Values ( ) As Variant )
The first parameter is the string that will be written to the current output stream. All additional parameters will be used as formatting information in the first parameter. If no parameters are provided, then an empty string is written with a NewLine.
The following example demonstrates how to write output to the console using the WriteLine method. There are 3 ways to use the WriteLine method effectively, and they are shown below.
Private Sub Main() ' writes a NewLine to the console Console.WriteLine ' writes a string followed by a NewLine Console.WriteLine "Hello" ' writes a formatted string using the ' supplied parameters, followed by a NewLine Console.WriteLine "Hello, {0}", "Kelly" Console.WriteLine "Press Return" Console.ReadLine ' waits for return key to continue End Sub ' This example produces the following output. ' (Blank Line) ' Hello ' Hello, Kelly ' Press Return