Re: [U2] Printing Reports In Universe BASIC

2007-03-19 Thread Anthony W. Youngman
In message <[EMAIL PROTECTED]>, MAJ 
Programming <[EMAIL PROTECTED]> writes

Could all of this SETPTR stuff be in a table that's easier to maintain. I've
added such to my UD and D3 clients.


I had a similar system. All the users names were stored in a file read 
at login, which contained amongst other things their default printer. 
(If the login program couldn't read their details, it prompted the user 
to create such a record.)


And all the printers had the relevant SETPTR command (and other stuff, 
like escape sequences for landscape etc) stored in another file.


So when a user logged in, the login procedure read their default printer 
from the user file, then passed that to another routine that read the 
printer details from the printer file and set that up.


When you've got some 10 printers scattered round an open-plan office, 
you need something like that ... especially when users have a habit of 
moving too ...


Cheers,
Wol
--
Anthony W. Youngman <[EMAIL PROTECTED]>
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site -  Open Source Pick
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Printing Reports In Universe BASIC

2007-03-15 Thread MAJ Programming
Could all of this SETPTR stuff be in a table that's easier to maintain. I've
added such to my UD and D3 clients.
- Original Message -
From: "Brutzman, Bill" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, March 15, 2007 11:04 AM
Subject: RE: [U2] Printing Reports In Universe BASIC


> Consider the following Universal UniVerse printer handler...
>
>
*---
> --
>
> *R0  Bill Brutzman  Aug.2006
>
> SUBROUTINE PRINTER.SETUP.R2 ( Mode )
>
> *--
> Printer.Setup :
>
>   begin case
> case Mode = 'Portrait'
>begin case
>  case @logname = 'jimr' ;  execute 'SETPTR
> ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PACK_3X'
>
> case @logname = 'lou'  ;  execute
> 'SETPTR ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT DOCK'
>
> case @logname = 'rich' ;  execute
> 'SETPTR ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT CUST'
>  case @logname = 'karen';  execute 'SETPTR
> ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT CUST'
>  case @logname = 'maria';  execute 'SETPTR
> ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT CUST'
>  case @logname = 'ed'   ;  execute 'SETPTR
> ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT CUST'
>
>case @logname = 'mike' ;  execute 'SETPTR
> ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PCNTRL'
>  case @logname = 'jimc' ;  execute 'SETPTR
> ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PCNTRL'
>  case @logname = 'jimt' ;  execute 'SETPTR
> ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PCNTRL'
>  case @logname = 'alex' ;  execute 'SETPTR
> ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PCNTRL'
>  case @logname = 'wayne';  execute 'SETPTR
> ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PCNTRL'
>
> case @logname = 'bobs' ;  execute
> 'SETPTR ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT ENG'
>
> case Mode = 'LandScape'
>begin case
>  case @logname = 'jimr' ;  execute 'SETPTR
> ,132,55,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PACK.LAND'
>  case @logname = 'bruce';  execute 'SETPTR
> ,132,55,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PACK.LAND'
>
> case @logname = 'lou'  ;  execute
> 'SETPTR ,132,55,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT DOCK.LAND'
>end   case
>
> case Mode = 'GreenBar'  ;
> execute 'SETPTR ,132,60,2,0,1,BRIEF,NFMT,AT PR0'
> case 1  ;
> execute 'SETPTR ,132,60,2,0,1,BRIEF,NFMT,AT PR0'
>   end   case
>
>   execute 'RESET.PRINTER'
>   PRINTER ON
>
> *--
> The.End :
>
>   RETURN
>   END
>
>
*---
> --
>
> I suppose that this would be a little more slick to have a UV file with a
> table of users and printers.
>
> HTH.
>
> --Bill
>
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Kevin King
> Sent: Thursday, March 15, 2007 10:06 AM
> To: u2-users@listserver.u2ug.org
> Subject: RE: [U2] Reports In Universe BASIC
>
>
> From: MAJ Programming
> >Like helping the newbies with MV, I can now add this
> >little tidbit to my mental library of techniques
> >should the need arise.
>
> Just because one can doesn't mean one should.  In the case of PRINT ON
> working properly without a corresponding PRINTER ON, imagine six
> months later trying to find all of the programs that are outputting to
> the printer.  Not only do we have to search for procs and paragraphs
> that start the program with a (P (or LPTR) option, but now in
> searching through the BP code we have to search for both PRINTER ON
> and PRINT ON.  It's likely that someone will forget one of those
> options (and possibly a few others I may have missed in this quick
> post) and overlook a program that should have otherwise been found.
>
> As this jihad on upper/lower case has illustrated, there are many ways
> to skin this U2 cat.  And the more ways we as a community use, t

RE: [U2] Printing Reports In Universe BASIC

2007-03-15 Thread Brutzman, Bill
Consider the following Universal UniVerse printer handler...

*---
--

*R0  Bill Brutzman  Aug.2006

SUBROUTINE PRINTER.SETUP.R2 ( Mode )

*--
Printer.Setup : 

  begin case
case Mode = 'Portrait'   
   begin case
 case @logname = 'jimr' ;  execute 'SETPTR
,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PACK_3X' 

 case @logname = 'lou'  ;  execute
'SETPTR ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT DOCK' 

 case @logname = 'rich' ;  execute
'SETPTR ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT CUST' 
 case @logname = 'karen';  execute 'SETPTR
,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT CUST' 
 case @logname = 'maria';  execute 'SETPTR
,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT CUST' 
 case @logname = 'ed'   ;  execute 'SETPTR
,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT CUST' 

   case @logname = 'mike' ;  execute 'SETPTR
,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PCNTRL'  
 case @logname = 'jimc' ;  execute 'SETPTR
,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PCNTRL' 
 case @logname = 'jimt' ;  execute 'SETPTR
,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PCNTRL' 
 case @logname = 'alex' ;  execute 'SETPTR
,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PCNTRL' 
 case @logname = 'wayne';  execute 'SETPTR
,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PCNTRL' 

 case @logname = 'bobs' ;  execute
'SETPTR ,80,60,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT ENG' 

case Mode = 'LandScape'
   begin case
 case @logname = 'jimr' ;  execute 'SETPTR
,132,55,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PACK.LAND' 
 case @logname = 'bruce';  execute 'SETPTR
,132,55,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT PACK.LAND' 

 case @logname = 'lou'  ;  execute
'SETPTR ,132,55,2,0,1,BRIEF,NHEAD,NFMT,NOEJECT,AT DOCK.LAND' 
   end   case

case Mode = 'GreenBar'  ;
execute 'SETPTR ,132,60,2,0,1,BRIEF,NFMT,AT PR0' 
case 1  ;
execute 'SETPTR ,132,60,2,0,1,BRIEF,NFMT,AT PR0' 
  end   case
 
  execute 'RESET.PRINTER'
  PRINTER ON

*--
The.End : 

  RETURN
  END

*---
--

I suppose that this would be a little more slick to have a UV file with a
table of users and printers.

HTH.

--Bill


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Kevin King
Sent: Thursday, March 15, 2007 10:06 AM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Reports In Universe BASIC


From: MAJ Programming
>Like helping the newbies with MV, I can now add this 
>little tidbit to my mental library of techniques 
>should the need arise.

Just because one can doesn't mean one should.  In the case of PRINT ON
working properly without a corresponding PRINTER ON, imagine six
months later trying to find all of the programs that are outputting to
the printer.  Not only do we have to search for procs and paragraphs
that start the program with a (P (or LPTR) option, but now in
searching through the BP code we have to search for both PRINTER ON
and PRINT ON.  It's likely that someone will forget one of those
options (and possibly a few others I may have missed in this quick
post) and overlook a program that should have otherwise been found.

As this jihad on upper/lower case has illustrated, there are many ways
to skin this U2 cat.  And the more ways we as a community use, the
harder we make it on ourselves to find something months after the
fact.  I dream of a day when programmers will have a response other
than "who was the idiot who wrote this crap?" when faced with
modifying someone else's program.  But alas, if this latest battle is
any indication, we're no closer to that day today than we were 20
years ago or possibly even 20 years before that.  And then we wonder
why our jobs are being shipped overseas?  It's pretty obvious, when
companies are faced with years and years of obfuscated and
unmaintainable code, why not get the same results from someone
overseas at a fraction of the price?

My intent is not to discourage my friends and esteeemed collegues in
this list, but rather to vent some frustration in the knowledge that
our communal past may be contributing to a negative impact on our
individual futures.  As a reasonably focused community (in contrast to
the millions of programmers in other environments) we have a real
fighting cha