Skip to Content
author's profile photo Former Member
Former Member

Try catch

I need to write a try catch method wrapped around this logic, in the try though I am checking to see if z7 is true then return DUNS then a catch statement that will return "FALSE", but for some reason z7 s not looking for the boolean true it is looking to find a string true, how do I get it to recognize booleon? and write the try catch?

String soldTo = "";

soldTo = CommonFunctions.executeValueMapping(z1[0],z2[0],z3[0],z4[0],z5[0],z6[0],z7[0],z8[0], container);

for (int i =0;i < z8.length; i++) {

if (z7<i>.equals(true)){

result.addValue("DUNS");

}

else{

result.addValue("false");

}

}

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Apr 25, 2011 at 04:38 PM

    Try this logic

    What is the data type of Z7 ? is it boolean or string?

    If it is boolean then code as  
    
    //if(z7)   as given below...
    
    if it is string then
    
    //if(z7.equals("TRUE"))
    
    
    
    try{
    String soldTo = "";
    
    soldTo = CommonFunctions.executeValueMapping(z1[0],z2[0],z3[0],z4[0],z5[0],z6[0],z7[0],z8[0], container); 
     for (int i =0;i < z8.length; i++) {
       if (z7){
         result.addValue("DUNS");
       }
     }
    } catch(Exception e){
    
        result.addValue("FALSE");
    
    }

    Edited by: Baskar Gopal on Apr 25, 2011 12:42 PM

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.