Via:      UK.AC.LIV.IBM;  9 APR 92 11:33:33 BST
Newsgroups: bit.listserv.wpcorp-l
Date:         Thu, 9 Apr 1992 11:28:06 BST
              <WPCORP-L@UBVM.BITNET>
From:         "Ms. Lucia Asturias" <LUCIA@LIVERPOOL.AC.UK>
Subject:      Att Macro EXPERTISE - 5.0 to 5.1 query

One of our WP users on Campus used to be able to print duplex (on both
sides of the page) using a HP Laserjet Series II  using WP 5.0.
This macro was programmed by the person who  trained me, but he's already
left and I'm stuck with this as I don't seem to get anywhere....!
I have tried editing {Print}P to {Print}2 for example to test it
using 5.1 but it seems to go on a 'no-end loop' and doesn't work.

I'd like some help from the 'experts' as I have to admit I have very little
expertise in the matter of macros.

Please RSVP to my address and I'll summarise to the list, on getting an
appropriate solution.

Thanks in advance, and here goes the macro text:

{DISPLAY OFF}

{TEXT}1~Enter first page number (0 for full document): ~

{IF}{VAR 1}=0~                          {;}Print full document~
        {Home}{Home}{Up}
        {CALL}NumPages~
        {ASSIGN}1~1~
        {ASSIGN}2~{VAR 0}~
        {GO}EvenPages~
{END IF}

{TEXT}2~Enter last page number (0 to end of document): ~
                                        {;}Print range of pages~
{IF}{VAR 2}=0~                          {;}To end of document~
        {Goto}{VAR 1}{Enter}            {;}Count Pages~
        {CALL}NumPages~
        {ASSIGN}2~{VAR 1}+{VAR 0}~
        {ASSIGN}2~{VAR 2}-1~
        {GO}EvenPages~
{END IF}

{IF}{VAR 2}<{VAR 1}~                    {;}Check valid range~
        {DISPLAY ON}
        {BELL}{PROMPT}ERROR: First page ({VAR 1}) is greater than last
page ({VAR 2})~
        {WAIT}20~
        {DISPLAY OFF}
        {Reveal Codes}{Reveal Codes}
        {QUIT}
{END IF}

{Goto}{VAR 1}{Enter}                    {;}Check have enough pages~
{CALL}NumPages~

{ASSIGN}4~{VAR 2}-{VAR 1}~
{ASSIGN}5~{VAR 0}-1~

{IF}{VAR 4}>{VAR 5}~                    {;}Not enough pages~
        {DISPLAY ON}
        {BELL}
        {TEXT}3~Too many pages, print from page {VAR 1} to end of document
(Y/N)? ~
        {DISPLAY OFF}
        {CASE}{VAR 3}~Y~YesPrint~y~YesPrint~~
        {Reveal Codes}{Reveal Codes}
        {QUIT}
        {LABEL}YesPrint~
        {Reveal Codes}{Reveal Codes}
        {ASSIGN}2~{VAR 1}+{VAR 0}~
        {ASSIGN}2~{VAR 2}-1~
        {GO}EvenPages~
{END IF}

{LABEL}EvenPages~                               {;}Do the printing~
{IF}{VAR 2}%2~                                  {;}Find last even page~
        {ASSIGN}3~{VAR 2}-1~
{ELSE}
        {ASSIGN}3~{VAR 2}~                      {;}Var 3 is current page~
{END IF}

{LABEL}PrintEven~                               {;}Print the even pages~
{Goto}{VAR 3}{Enter}
{Print}2
{DISPLAY ON}
{PROMPT}Queuing page {VAR 3}...~                {;}Only with large print job~
{WAIT}20~
{DISPLAY OFF}
{ASSIGN}3~{VAR 3}-2~
{IF}{VAR 3}<{VAR 1}~                            {;}Still greater than 1st page~
        {GO}OddPages~
{END IF}
{GO}PrintEven~

{LABEL}OddPages~
{DISPLAY ON}
{BELL}{PROMPT}Wait for even pages to print, replace paper in drawer,
press Enter...~
{PAUSE}
{DISPLAY OFF}
{IF}{VAR 1}%2~                                  {;}Find first odd Page~
        {ASSIGN}3~{VAR 1}~
{ELSE}
        {ASSIGN}3~{VAR 1}+1~                    {;}Var 3 is current page~
{END IF}

{LABEL}PrintOdd~
{Goto}{VAR 3}{Enter}
{Print}2
{DISPLAY ON}
{PROMPT}Queuing Page {VAR 3}...~
{WAIT}20~
{DISPLAY OFF}
{ASSIGN}3~{VAR 3}+2~
{IF}{VAR 3}>{VAR 2}~                    {;}Past last page~
        {GO}EndDuplex~
{END IF}
{GO}PrintOdd~

{LABEL}EndDuplex~
{DISPLAY ON}
{BELL}{PROMPT}Pages queued for printing...~
{WAIT}20~
{DISPLAY OFF}
{Reveal Codes}{Reveal Codes}
{Home}{Home}{Up}
{QUIT}

{LABEL}Numpages~                        {;}Counts no of pages from~
{BELL}                                  {;}current page to end~
{DISPLAY ON}                            {;}of document~
{PROMPT}Counting pages...~
{WAIT}20~
{DISPLAY OFF}

&&&                                     {;}Mark first page~
{Home}{Home}{Down}                      {;}Positions cursor after last~
{Page Up}{Page Down}                    {;}[SPg] or [HPg]~
$$$                                     {;}Mark last page~
{Search Left}&&&{Search}                {;}Move back to start position~
{ASSIGN}0~1~                            {;}Initialise page count~

{LABEL}NextPage~
{Page Down}
{ASSIGN}0~{VAR 0}+1~                    {;}Increment page count~
{Block}{Right}{Right}{Right}            {;}Test for last page marker~
{Macro Commands}39
{Left}{Left}{Left}                      {;}Move back to top of page~
{IF}"{VAR 9}"="$$$"~
        {GO}EndNumPages~
{END IF}
{GO}NextPage~

{LABEL}EndNumPages~
{Del}{Del}{Del}                         {;}Delete $$$ marker~
{Search Left}&&&{Search}                {;}Move back to start position~
{Backspace}{Backspace}
{Backspace}                             {;}Delete &&& marker~
{RETURN}
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU