PrintGetPrinter

Description

Gets the current printer name.

Syntax

PrintGetPrinter ( )

Return value

String. Returns current printer information in a tab-delimited format: printername ~t drivername ~t port.

Usage

The current printer is the default printer unless you change it with the PrintSetPrinter method. A PowerBuilder application calling the PrintGetPrinter method does not get an externally reset default after the application initializes.

Examples

This example places the current printer name, driver, and port in separate SingleLineEdit textboxes:

String ls_fullstring
ls_fullstring=PrintGetPrinter()
String ls_name, ls_driver, ls_port, ls_temp
Long ll_place
ll_place=pos (ls_fullstring, "~t")
ls_name=left(ls_fullstring, ll_place -1)
ls_temp=mid(ls_fullstring, ll_place +1)
ll_place=pos (ls_temp, "~t")
ls_driver=left(ls_temp, ll_place -1)
ls_port=mid(ls_temp, ll_place +1)
sle_1.text=ls_name
sle_2.text=ls_driver
sle_3.text=ls_port

See also

PrintGetPrinters

PrintSetPrinter