Hi All,
I am using a DataBase Bean to gather data to populate a list box.  I
can't seem to get an "if" statement inside of a "for" loop to work.  I
know that I have conditions that meet the "if" criteria, but nothing
ever get loaded in my OPTION tag.  However, if I remove the "if"
condition, the box loads great.

Hear is the code snippet:

<%
try {
  java.lang.String _p0 = CN31CiDBBean.getCITY_CODE(0); // throws an
exception if empty.
  java.lang.String _c0 = CN31CiDBBean.getCOUNTRY_CODE(0); // throws an
exception if empty.
  java.lang.String _x0 = CN31CiDBBean.getO_COUNTRY_CODE(); // throws an
exception if empty.

  %><SELECT name="O_CITY_CODE" size="1"><%
    for (int _i0 = 0; ; ) {
      if ( _c0 == _x0 ) { %>
      <OPTION value="<%= _p0 %>"><%= _p0 %></OPTION><%
      }
      _i0++;
      try {
        _p0 = CN31CiDBBean.getCITY_CODE(_i0);
        _c0 = CN31CiDBBean.getCOUNTRY_CODE(_i0);
      }
      catch (java.lang.ArrayIndexOutOfBoundsException _e0) {
        break;
      }
    } %></SELECT><%
}
catch (java.lang.ArrayIndexOutOfBoundsException _e0) {
} %>


Thanks in advance for any help.
--
Jay H. Lang
Chief Technologist
Distributed Computing Professionals Inc.
IBM Certified Specialist - MQSeries
303 277-1873 - Office
303 807-9700 - Cell

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to