Printer.Print Method (Object[])

 

Prints text to a page.

Namespace:   Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntax

public void Print(
    params object[] args
)
public:
void Print(
    ... array<Object^>^ args
)
member Print : 
        [<ParamArrayAttribute>] args:Object[] -> unit
Public Sub Print (
    ParamArray args As Object()
)

Parameters

  • args
    Type: System.Object[]

    A parameter array containing optional printing parameters.

Remarks

The Print method resets CurrentX and CurrentY to the next line after executing (the same as inserting a carriage return). To continue printing on the same line, call the Write method instead.

Multiple expressions can be separated by either a space or a semicolon.

Note

Because the Print method typically prints with proportionally-spaced characters, there is no correlation between the number of characters printed and the number of fixed-width columns that those characters occupy. For example, a wide letter, such as a "W," occupies more than one fixed-width column, and a narrow letter, such as an "i," occupies less than one column. To allow for cases in which wider than average characters are used, your tabular columns must be positioned far enough apart. Alternatively, you can print in a fixed-pitch font (such as Courier) to make sure that each character occupies only one column.

The args() parameter array has the following syntax and parts:

{Spc(n) | Tab(n)} expression charPos

Parameter

Description

Spc(n)

Optional. Used to insert space characters in the output, where n is the number of space characters to insert.

Tab(n)

Optional. Used to position the insertion point at an absolute column number, where n is the column number. Use Tab without an argument to position the insertion point at the start of the next print zone.

expression

Optional. Numeric expression or string expression to print.

charPos

Optional. Specifies the insertion point for the next character. Use a semicolon (;) to position the insertion point immediately after the last character displayed. Use Tab(n) to position the insertion point at an absolute column number, where n is the column number. Use Tab without an argument to position the insertion point at the start of the next print zone. If charPos is omitted, the next character is printed on the next line.

Note

Functions and objects in the Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 namespace are provided for use by the tools for upgrading from Visual Basic 6.0 to Visual Basic. In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework. They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework implementation.

Examples

The following example demonstrates the Print method.

Dim Printer As New Printer
Printer.Print("Total (" & (19 + 300) / 4 & ")")
Printer.EndDoc()

See Also

Printer Class
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 Namespace

4e434922-3709-49c6-a69d-38120ed72d7a7f9351ea-cb3e-4615-8f70-5a29c165c1a7bc1bcb98-e13b-4c68-a514-045c042dbf36

Return to top