SetupDevice - v14


setupdevice              NAME=<string value>,SETUP

Function

Set the current printing device and open the selected device dialog for setting the device parameters.

Parameters

names

the name of the selected printing devices.
 

SETUP

SETUPDEVICE (from v12.3.3) requires the primer SETUP to open the printer device panel. E.g:

SETUPDEVICE name=devs[1],SETUP

That because it is now possible to set the format size, orientation  and scale with:

SETUPDEVICE name=devs[1],SIZE=’A4’

SETUPDEVICE name=devs[1],ORIENT=’PORTRAIT’ (or ANDSCAPE’)

SETUPDEVICE name=devs[1],SCALE=50

Important: the SIZE must be set before the orientation and scale.

The command GETDEVICEINFO introduced at the same time to query  information about the selected printer and using this command it is possible to confirm settings such as format size, orientation, scale and supported formats.

Examples

String names[0]
Listdevice name=names[1]
SetupDevice name=name[4]

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

LISTdevice