LISTIMP

Contents


Listimp is used to retrieve the list of printer names attached to a print server or to the client workstation.

Syntax

   Listimp param = id_serveur

Parameters

Element

Description

Restrictions

param

 

 

id_serveur

identification of a print server as:
machine.domain:port@

Examples

Local Char PARAMETRE(250)(1..100)
Local Char SERVEUR(30)
Local Char TEXTE(250)(1..50)
Local Integer ITT,RG,NBIMP,NBTEX

#For instance: retrieval of the names of the printers attached
# to the print server.
SERVEUR="impser.com:1969@"
Listimp PARAMETRE = SERVEUR
RG=instr(1,PARAMETRE(1),chr$(1))
NBIMP=val(num$(ascii(mid$(PARAMETRE(1),RG+1,1))))
Raz TEXTE,TEX,NBTEX
For ITT=1 To NBIMP
  RG=instr(1,PARAMETRE(ITT+1),chr$(1))
  NBTEX+=1
  TEXTE(NBTEX)=mid$(PARAMETRE(ITT+1),RG+1,len(PARAMETRE(ITT+1)))
  If ITT=50 : Break 1: Endif
Next ITT

Description and comments

Listimp is used to choose a print server in order to get the information on the associated printers. If the print server is not entered, the available information will be the one on the printers associated with the client workstation.

The 1st parameter param contains all the data returned by the instruction. In the first section of the param table, the number of printers defined on the print server (or client workstation) is obtained. In the following sections, the name of these printers is obtained (in other words, the _PrinterName as it has been defined in the Selimp instruction).

The 2nd parameter id_serveur contains the identification string of the print server on the network. This string contains a mandatory part and an optional part (in italic letters here below)  "machine.domain:port@"

For instance:
Listimp PARAMETRE = "impser.com:1969@"
Listimp PARAMETRE = "impser.com"

If the optional part is not entered, then by default, the communication will be set up with the print server using the current connection port of the X3 session executing the "Listimp" instruction. 

To obtain the printers defined on the client workstation:
Listimp PARAMETRE = ""

Associated errors

Error

Description

 

 

Associated keywords

Stat1 - Selimp


CONTENTS

Copyright © Sage 1999 - 2007