Solved

Else If Statement - with one or another variable

Posted on 2004-08-26
2
258 Views
Last Modified: 2010-04-01
Hi, How do I create an if/else statement in which I want it to do the same thing if either of 2 variables are entered? Here is my code:


String mode = request.getParameter("mode");

out.print("<td><center>");
      if (mode.equals("largeimages"))
      {
            String imagenumber = request.getParameter("imagenumber");
            out.print("<a href=\"deleteimages.jsp?mode=" + mode + "&imagenumber=" + imagenumber + "\">");
      } else if (mode.equals("listaccession") OR mode.equals("listaccessionall"))
      {
            String last2 = request.getParameter("last2");
            out.print("<a href=\"deleteimages.jsp?mode=" + mode + "&last2=" + last2 + "\">");
      } else
      {
            out.print("<a href=\"deleteimages.jsp?mode=" + mode + "&series=" + series + "\">");
      }
out.print("<font size=2>Unselect Image</font>");
out.print("</a></center></td>");


Thank you for your help in advance.
AKamauu
0
Comment
Question by:akamauu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
pat5star earned 125 total points
ID: 11908739
    } else if (mode.equals("listaccession") || mode.equals("listaccessionall"))

|| is how you say OR

-Pat
0
 

Author Comment

by:akamauu
ID: 11908872
Thank you ... that worked great.

AKamauu
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Learn why we support net neutrality and why the topic is important to all internet users.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question