# PrintTextBuffer

int PrintTextBuffer (char buffer[], char outputFile[]);

## Purpose

Prints the contents of a text buffer. You can direct the output to the printer or to a file. If you pass an empty string ("") to the outputFile parameter, this function prints the contents of the text buffer to the default printer.

When you print the text buffer, the following occurs:

- Newline/carriage-return characters are honored.
- Tabs expand according to the current state of the ATTR_TAB_INTERVAL attribute. You can modify this attribute with SetPrintAttribute. The default tab interval is four.
- Text that extends beyond the end of the paper either truncates or wraps, depending on the state of the ATTR_TEXT_WRAP attribute. You can modify this attribute with SetPrintAttribute. The default is wrap.
- An ASCII NUL byte marks the end of the buffer.

While this function is printing, it blocks any other thread in your program that attempts to print.

Remember that LabWindows/CVI maintains only one copy of the print attributes you set with SetPrintAttribute. Thus, when you change a print attribute in one thread, the change affects printing functions you subsequently call in other threads.

## Parameters

Input
Name | Type | Description
buffer | string | Text to print. Must be terminated by an ASCII NUL byte.
outputFile | string | Name of the output file. If the name is not empty, the output is redirected to the file. If you pass an empty string (""), this function prints the contents of the text buffer to the default printer. If outputFile is a not a complete pathname, it is created relative to the current working directory.

## Return Value

Name | Type | Description
status | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
Code | Error Message String
xx | Success