| 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 tothe console using the WriteLine method. There are 3 ways touse 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 '' The above code outputs '' '' (Blank Line) '' Hello '' Hello, Kelly '' Press ReturnEnd SubAs you can see, the WriteLine method accepts a variaty ofparameters to create differently formatted outputs to the Console.The first parameter is the string to be written to the console, whileany additional parameters are used by formatting information withinthe first parameter.
Project VBCorLib Overview Class Console Overview Console Properties Console Methods WindowWidth (let) WriteValue