List printers and set the default

#1
I'm working on a (SYSUTILS) plugin to list the printers and set the default printer. So far I have this working model (far below). Suggestions would be appreciated. One thought is to implement (instead) some of:

Code:
_NPRNTRS = number of printers
_DEFPRNTR = index (or name?) of default printer
@PRNTR[index] = name of printer
DEFPRNTR index (or name?) ... set default printer
(although what I have now is short and simple).

Code:
g:\projects\4sysutils\release> ptrs /?

PTRS [N] ... list printers [or set default to printer N]

g:\projects\4sysutils\release> ptrs
Index:  0
Name:   Microsoft XPS Document Writer

Index:  1
Name:   HP LaserJet P4014/P4015 PCL6

Index:  2 (Default)
Name:   HP LaserJet 1020

Index:  3
Name:   Adobe PDF

g:\projects\4sysutils\release> ptrs 0

g:\projects\4sysutils\release> ptrs
Index:  0 (Default)
Name:   Microsoft XPS Document Writer

Index:  1
Name:   HP LaserJet P4014/P4015 PCL6

Index:  2
Name:   HP LaserJet 1020

Index:  3
Name:   Adobe PDF
 
#4
From: vefatica
| It's good to know you've done all that. I'll leave mine as simple as
| possible.

Do you intend yours to do anything Charles' won't? Regardless, I'd suggest you make yours independent of SYSUTIL.DLL - I have (and I am sure some others, too) have them both SYSUTIL andPRINTERSTUFF loaded; don't want naming conflicts.
--
Steve
 
#6
On Sun, 16 Oct 2011 18:07:16 -0400, Steve Fabian <> wrote:

|From: vefatica
|| It's good to know you've done all that. I'll leave mine as simple as
|| possible.
|
|Do you intend yours to do anything Charles' won't? Regardless, I'd suggest you make yours independent of SYSUTIL.DLL - I have (and I am sure some others, too) have them both SYSUTIL andPRINTERSTUFF loaded; don't want naming conflicts.

The only name I intend to use is PRNTRS. I'll change it if Charles uses it. I
whittled it down to this.

Code:
v:\> prntrs /?
PTRS [N] ... list printers [or set default to printer N]

v:\> prntrs
0       "Microsoft XPS Document Writer" (Default)
1       "HP LaserJet P4014/P4015 PCL6"
2       "HP LaserJet 1020"
3       "Adobe PDF"

v:\> prntrs 2

v:\> prntrs
0       "Microsoft XPS Document Writer"
1       "HP LaserJet P4014/P4015 PCL6"
2       "HP LaserJet 1020" (Default)
3       "Adobe PDF"