xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

IsPrinter()

Determines if print output can be processed.

Syntax

IsPrinter( [<cPrinterName>] ) --> lIsPrinter

Arguments

<cPrinterName>
An optional character string holding the name of a particular printer driver.

Return

The function returns .T. (true) when the operating system can process print output, otherwise .F. (false) is returned.

Description

The IsPrinter() function is used to test if an application can pass print output to the operating system. This is usually the case when a print spooler is active. IsPrinter() cannot detect, if a physical printer is ready to print, since this is monitored by the operating system.

If a character string holding a particular printer name is passed, IsPrinter() returns .T. (true) if this printer is installed.

Note:  under CA-Clipper (DOS), IsPrinter() checked the readiness of a physical printer. This is not possible with xHarbour's IsPrinter() function due to differences between DOS and modern operating systems.

Info

See also:GetDefaultPrinter(), GetPrinters(), PCol(), PRow(), SET DEVICE, SET PRINTER, SetPrc()
Category: Printer functions
Source:rtl\isprint.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example outlines possibilities of getting printer information
// different from CA-Clipper (DOS).

   PROCEDURE Main
      LOCAL aPrinter := GetPrinters()

      ? ValToPrg( aPrinter )

      ? GetDefaultPrinter()

      ? IsPrinter()

      ? IsPrinter( aPrinter[1] )

      ? IsPrinter( "HP LaserJet" )
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe