Porovnávané verzie
porovnané s
Kľúč
- Tento riadok sa pridal
- Riadok je odstránený.
- Formátovanie sa zmenilo.
%GetPrinterName function
Function
The function retrieves either the number of printers in the operating system or the name of a specified printer.
Declaration
Blok kódu | ||||
---|---|---|---|---|
| ||||
INT | TEXT %GetPrinterName( INT in _printerIdx INT in _propIdx := 0 ) |
Parameters
_printerIdx | Serial number of printer (1, ...). |
_propIdx | Optional parameter - type of information to be retrieved. Possible values:
|
Description
After the function is called for the first time, it retrieves a list of printers defined in the operating system. That list is to be stored within the D2000 system and the function can retrieve an information on printers from it.
Behaviour of the function depends on the value of the parameter _printerIdx as follows:
Behaviour of the function depends on the value of the parameter _printerIdx as follows:
- _printerIdx=-1 - the function rereads (refresh) the list of printers in the operating system and returns this number (the parameter _propIdx is ignored)
- _printerIdx=0 - the function retrieve retrieves the number of printers (the parameter _propIdx is ignored)
- _printerIdx=1, 2, 3, ... - the function retrieves required information (specified by the parameter _propIdx) on the given printer
Note
The function can be used for Windows platforms only.
Example
Blok kódu | ||||
---|---|---|---|---|
| ||||
BEGIN ; INT _nrPrinters INT _pIdx ; TEXT _printerFullName TEXT _printerName TEXT _serverName ; retrieve the number of printers in operating systems _nrPrinters := %GetPrinterName(-1) ; retrieve information on each printer FOR _pIdx=1 TO _nrPrinters DO_LOOP _printerFullName := %GetPrinterName(_pIdx, 0) _printerName := %GetPrinterName(_pIdx, 1) _serverName := %GetPrinterName(_pIdx, 2) END_LOOP ; END |