Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Oct 2004
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Method killing execution

    This method is being used to sort selected values into an array from a webpage form, the form and the CGI is working fine. Whenever I use this method to sort the selected values the execution of the program pretty much stopsand I do not know why?

    The method gets within the first if statement but whenever it has to jump into a second one thats when it appears to stop executing.

    FYI: String array's s1,s2,s3 are instantiated global arrays but I have not declared their length.

    Code:
    public void sortSelects( String g, String v)
        {       
          
            if ( g.charAt(0)=='1' )
            {
                if ( v.equals("bold") || v.equals("italics") || v.equals("underline") )
                {
                    s1[0] = v;
                    System.out.println( v + "of " + g + "inserted into s1");
                }
                else if ( v.equals("blue") || v.equals("black") || v.equals("green") || v.equals("red") )
                {
                    s1[1] = v;
                    System.out.println( v + "of " + g + "inserted into s1");
                }
                else if ( v.equals("right") || v.equals("left") || v.equals("center") )
                {
                    s1[2] = v;
                    System.out.println( v + "of " + g + "inserted into s1");
                }
            }
          }
    vbCode [code] tags are great for retaining the formatting of your code, make sure to use them from now on. - antoniohawk (your oh-so-friendly moderator)
    Last edited by Antoniohawk; 11-02-2004 at 04:39 AM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •