[thelist] if/else
Gerenday, Perry (P.)
pgerenda at visteon.com
Thu Nov 1 11:53:57 CST 2001
-----Original Message-----
From: Teck Low [mailto:TeckLLow at rainbowhouseinc.com]
> How could I make 3 statements into if/else depending on p1
> and p2? Only 1 of
> 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> '; };
Teck,
Here's the way I would do it. To test a condition don't you need two equal
signs?
function LemmeCheck()
{ if(p1==1)
{ pagetxtnx = href + p1 + '">Next</a> ';}
else
{ if(p1>1 && p1<p2)
{ pagetxtbk = href + (p1-2) + '">Back</a> ';
pagetxtnx = href + (p1+2) + '">Next</a> ';}}
else
{ if(p1==p2)
{ pagetxtbk = href + (p1-2) + '">Back</a> ';}}
}
HTH
Perry Gerenday, Visual Communications Artist
www.virtually-artistic.com
More information about the thelist
mailing list