[thelist] if/else

martin.p.burns at uk.pwcglobal.com martin.p.burns at uk.pwcglobal.com
Thu Nov 1 11:50:08 CST 2001

Memo from Martin P Burns of PricewaterhouseCoopers

-------------------- Start of message text --------------------

Assuming that p1 is the current page, p2 is the
last page and both are always integers...
and also building in a constraint in
case you ever want 1 page (ie set p2 to 1)

if ((lastPage >1) && (currentPage<=lastPage) {
    if(currentPage == 1) {
        pageHTML = href+currentPage+'">Next</a>  ';
    } elseif (currentPage == lastPage) {
        pageTextBack = href+(currentPage-1)+'">Back</a>  ';
    } else {
          pageTextBack = href+(currentPage-1)+'">Back</a>  ';
          pageTextNext = href+(currentPage+1)+'">Next</a>  ';

To:   thelist at lists.evolt.org
Subject:  [thelist] if/else

How could I make 3 statements into if/else depending on p1 and p2? Only 1
the 3 conditions will be true.

if(p1=1) { pagetxtnx=href+p1+'">Next</a>  '; };
if(p1>1 && p1<p2)
   pagetxtbk=href+(p1-2)+'">Back</a>  ';
     pagetxtnx=href+(p1+2)+'">Next</a>  '; };
if(p1=p2) { pagetxtbk=href+(p1-2)+'">Back</a>  '; };

--------------------- End of message text --------------------

This e-mail is sent by the above named in their
individual, non-business capacity and is not on
behalf of PricewaterhouseCoopers.

PricewaterhouseCoopers may monitor outgoing and incoming
e-mails and other telecommunications on its e-mail and
telecommunications systems.
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.   If you received
this in error, please contact the sender and delete the material from any

More information about the thelist mailing list