LISTDevice - v14


listdevice                   NAME(S)=<s_array> {, SHARE(S)=<s_array> }

Function

Fill the given array/s with the names and/or ports (network connections shared names) of the printing devices (printers, plotters) available on the network for that client. The NAME primer is used to select the device and the SHARE primer is used to
connect to the device (Xplot or WinPlot).

Parameters

names

the name of a string array that will contain all the names of the available printing devices.
 

shares

the name of a string array that will contain all the connection names of the available printing devices.

Examples

String names[0], shares[0]
Listdevice name=names[1], shares=shares[1]

Notes

{
string Names[100], Shares[100]
string PrinterName
numeric indx

listdevice names=Names[1],shares=Shares[1]

panel p=8,off
panel p=8,on,u=1,c=600,r=400,t='Select the device',pin=0,j=.2,.9
option p=8,f=print.tab

Label MainLoop
polling;;
if vb=2 : go Fine
go MainLoop

Label Select
PrinterName=st
indx=1
while Names[indx]<>''
{
if Names[indx]=PrinterName then
{
# if the device is local the share name is set to the device name
# otherwise it is the one returned by Windows
if len(Shares[indx]) = 0 :insert p=8,b=5,t=Names[indx]
elseinsert p=8,b=5,t=Shares[indx]
go MainLoop
}
indx=indx+1
}
go MainLoop

Label Break
break
go MainLoop

Label Exec
setupdevice name=PrinterName

Label Fine
panel p=8,off
}
iferr; exit

See also

SETUPdevice