aspose file tools*
The moose likes Beginning Java and the fly likes Simple if logic problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Simple if logic problem" Watch "Simple if logic problem" New topic
Author

Simple if logic problem

mandlar suurla
Ranch Hand

Joined: Jun 11, 2008
Posts: 67

Im in trouble with simple if statement, i dont know how to make code with less if's.

Here is code sorry its picture, but when you rotate it, then its readable. As you can see there's to many if-s. So has anyone better solution.
Program needs to be sure that there isnt that file in ftpList and in fileList before adding.
http://img528.imageshack.us/img528/7842/scan2ee7.png
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Wow... That's some minimal effort. I think you'll get better responses if you take the time to type a few lines of code instead of posting a rotated image of hand-written material.

I can't make out the specifics enough to know what this is supposed to be doing, but it looks like you have something like...

If your goal is reduce the if's, this could be written as...

I hope this helps, but if you respond with more detail, please type the code.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Here is code sorry its picture, but when you rotate it, then its readable.


suggested link is extremely hard to read and many people that might be able to help you will just move along. Please read this for more information.

You can go back and change your post to add the picture code by clicking the .


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
mandlar suurla
Ranch Hand

Joined: Jun 11, 2008
Posts: 67

I just didn't have computer that time so i need to write by hand.
Here is real code. I dont know why but every time i write it drives me crazy.



As soon as i posted code here i looked it and found answer, i dont know is it best way but it should work.


[ July 09, 2008: Message edited by: mandlar suurla ]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18669
    
    8

Excluding some typing errors and obvious blunders, I think that code reduces to this code:
mandlar suurla
Ranch Hand

Joined: Jun 11, 2008
Posts: 67

Yea that could be but i need two different JoptionPane codes look << in code
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18669
    
    8

I assumed that was one of your typing errors. So they both have to be YES? Okay, then change the criteria to include both of them.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Simple if logic problem