Stupid condition IF question

hi all ! I need to create this condition where you need to have all the conditions. One of the conditions is that the quantity OR the price have to be over 50 and if one of this is true you need to comply with all the rest.
So I made something like:
  if( (cdr.getString("product_id").equals(excel.get(i).getItemnumber_Ventas())) &&
(cdr.getString("location").equals(excel.get(i).getLocation_Ventas()))  &&
(cdr.getString("Country").equals(excel.get(i).getCountry_Ventas())) &&
(  (excel.get(i).getQuantity_Ventas()>=50) || (excel.get(i).getUnitprice_Ventas()>=50) ) ){ But Im not getting inside the IF condition...
Any ideas?
Thanks!
Edited by: juanmanuelsanchez on Apr 6, 2010 2:06 AM
Edited by: juanmanuelsanchez on Apr 6, 2010 2:07 AM

Hi,
I think you can use condition following:
if (cdr.getString("product_id").eqquals(excel.get(i).getItemnumber_Ventas()) {
     if(cdr.getString("location").equals(excel.get(i).getLocation_Ventas())) {
        if( cdr.getString("Country").equals(excel.get(i).getCountry_Ventas())) {
          if( excel.get(i).getQuantity_Ventas()>=50)) {
             //TODO: do something --> call functions Fx
          else if((excel.get(i).getUnitprice_Ventas()>=50) ) ) {
             //TODO: do something --> call functions Fx
}It's easy manage code and system will run faster.

Similar Messages

  • Multiple condition checking question

    Hi I have a newbie question -
    if ((temp == null) && (!temp.text.equals(""))) {
    statement;
    If temp really is null, would this give a compiler error? or would it simply break after the first condition?
    Thanks,
    Mike

    whatsupdoc wrote:
    Hi I have a newbie question -
    if ((temp == null) && (!temp.text.equals(""))) {
    statement;
    If temp really is null, would this give a compiler error?Compile it and see.
    I'm curious though what you're trying to accomplish. You seem to be confused about the meaning of &&.
    or would it simply break after the first condition?&& and || are "short-circuit" operators. They stop evaluating once the truth of the operation is known. So if the first operand to && is false, it stops there and does not evaluate the second, since the result of the && must be false, regardless of what the second operand is. Likewise, if the first operand to || is true, then it doesn't evaluate the second one, because the result is true regardless.

  • Conditional operator question?

    Hello,
    Quick question, are we not allowed to use the conditional operator this way... see code below:
    char volatile ProgString_[] = "\
    {Fan code} \
    12 <Limit11> [C1_ACM2]_[B1] _AND_ \
    bla bla \
    unsigned char UPC_SYSZ_EndOfTable(unsigned long i){ // Find the double '*' in string
    char volatile *u;
    u = &ProgString_[i];
    if(!(strncmp("*", u, 1))){
    i++;
    u = &ProgString_[i];
    if(!(strncmp("*", u, 1))){
    return TRUE;
    else {
    return FALSE;
    else
    return FALSE;
    void UPC_SYSZ_Parse(){
    unsigned char volatile iOCntr = 0;
    unsigned long volatile i;
    for(i=0; i<200; i++){
    (UPC_SYSZ_EndOfTable(i))?(break):(continue); //<<<<< Invalid expression ??
    I would of used the following compact line:
    (UPC_SYSZ_EndOfTable(i))?(break):(continue);    //<<<<< Invalid expression ??
    to periodically test the end of the string by fetching the "EndOfTable() function and evaluating if the double star is detected.
    If detected, I would break out of the for loop, if not then I would continue.
    Is it possible to do it this way?
    thanks for all help!
    r

    Think of it along the lines of each of the operands of the ternary operator must produce a value (which of course break and continue being statements cannot do).
    Based on your brief example here is what I would do
    for(i=0; i<200; i++){
    if (UPC_SYSZ_EndOfTable(i)) break;
    // doesn't make any sense to put more code down here anyway, so no real point to continue}

  • Stupid, but essential question : Waiting until Spring for new MB

    I know, I know....this is yet another one of those stupid questions....but I can't stop thinking about it...
    After two delayed shipment dates, I am kinda sick of Apple as of right now....I'm hearing that they're possibly coming out with a new MB this coming spring. The new MB supposedly comes with the core 2 duo processor, and a new logic board to fully take advantage of the new processor. I do have a vaio laptop right now..so I guess I don't mind waiting.....except the grueling pain of wanting to have an apple for the next....6 months.....
    What would YOU do?.....(should I just wait for my MB to come or should I cancel the order and wait 'til next spring?....)
    (again, I know this is a stupid question, so don't mention it....I just wanted to get the general public perspective.)

    yellowman-
    i was in the same position as you and i totally understand how you feel.
    in my case, i could not wait (eventhough i desperately wanted to) because my school starts in a less than a week so i needed a notebook. i received my macbook about a week ago without major problems. all seems to be working fine. however, after owning it, there is really nothing special about the macbook. sure, it's more attractive than other notebooks, but it gives you nothing more and nothing less(except the operating system) than what dell or sony has to offer.
    and besides, include me in the less-impressed customer category of the macbook series. even with little things that happen with my macbook (ie overheating), i get paranoid for no apparent reason. simply put, the macbook is a torturing machine. no righful owner should feel this way.
    with the macbook series, apple has progressed in terms of the style and versitility that they can bring out to the market. however, they have taken a step backwards in terms of reliability. you should wait for the second generation macbooks where they will be more familiar with its design flaws and hopefully will make it better.
    so in conclusion, i'll give you a little SAT format summary:
    apple is to steve jobs; as macbook is to paris hilton.
    if that makes sense

  • Conditional Test Questions

    Is there a way to setup conditional questions in a test? For example, if you answer "Have you ever been arrested?" with Yes, then you are required to answer "Tell us date of your arrest, offense, and disposition of case, including time in the slammer." If you answer No, then the second question does not appear.
    I have gone through the documentation and Metalink and cannot find a way to do this.

    This is currently not possible in our assessment builder, but we can integrate via AICC or SCORM with other assessment tools such as Questionmark Perception that can handle this requirement.
    Scott

  • Pricing condition table and condition type question

    hi guys,
    We can use same condition table in pricing for multiple condition types.I am wondering how system knows which condition records should be applicable for which condition type in the same table.
    I know the structure KOMV has those details,but thats used during the run time.
    Do we have database table which preserve this relation /link ? Please help.
    I also would like to know the  tables / fields /structures  which can be used at run time for defining requirements in pricing procedures.
    Thanks
    Dona

    Hi,
    Condition types are assigned with access sequences.
    These are the determining sequences in order to select which condition table is to be selected for that particular scenario.
    Generally the access sequences are tested to the condition records on their priority basis.
    pricing procedure
    condition type
    access sequence
    condition table
    selection records.
    hope this would help you understand the concept.
    regards,
    Siddharth.

  • Stupid Java Development Question (JDK? XCode?)

    I'm brand new to OS X, so forgive my noobness. I'm still getting used to OS X.
    I'm doing this little Java tutorial. It says I need to download an install the Java JDK. As I understand it, Java is already built into OS X and I need to use XCode to create and compile Java programs instead of the JDK....where the heck is XCode?
    If anyone knows, I could really use some help. Just finished going through the basics of how to make simple programs in Java but I don't know what to do! Lol. I feel so dumb. I kind of want to call Apple, but I think I'd feel to stupid. I think I have to download XCode? That's what I'm doing now. I had to sign up with the ADC. It's a big file though, 915MB, and it's probably going to take around an hour. I hope someone can tell me if I'm doing the right thing or not before then. I'm guessing I just download this and use this to write Java? How then do I compile? The tutorial is telling me to go to the command prompt and do:
    Code:
    javac filename.java
    to compile the class and then,
    Code:
    java classname
    to execute.
    I'm guessing that in OS X I'm going to use the terminal to accomplish this?
    Any help would be appreciated. I feel really dumb right now. The tutorial only covers how to do this in Windows and Solaris.

    Hi Ralph
    I'm doing this little Java tutorial. It says I need
    to download an install the Java JDK. As I understand
    it, Java is already built into OS X and I need to use
    XCode to create and compile Java programs instead of
    the JDK....where the heck is XCode?
    Go to http://developer.apple.com/ and sign up for a free Apple Developer Connection account. Once you've logged in, go to Downloads and you'll be able to find the latest versions of Xcode and Java. When it comes to downloading Java, take care to choose the version which matches your hardware and version of OS X.
    [snip] It's a big file though, 915MB,
    and it's probably going to take around an hour. I
    hope someone can tell me if I'm doing the right thing
    or not before then. I'm guessing I just download this
    and use this to write Java? How then do I compile?
    Yes - they're big files and you need to persevere with the downloads. Once you've got Xcode and Java installed, you can find some newby tutorials on my web page here:
    http://www.cems.uwe.ac.uk/~lrlang/javasoundmusic/index.html
    You'll find the links to tutorials near the bottom of the page.
    The tutorial is telling me to go to the command
    prompt and do:
    Code:
    javac filename.java
    to compile the class and then,
    Code:
    java classname
    to execute.
    I'm guessing that in OS X I'm going to use the
    terminal to accomplish this?
    Yes. This technique works for any Unix system (including OS X), and I used to teach my students to work this way, but I no longer recommend it. As you guessed, you have to type in these commands into the Utilities/Terminal program. However, to be effective you also need to know a number of other Unix commands like "cd" "ls", "pwd" and a few more which you can find in any introductory book on Unix. You also need to use a text editor (such as TextEdit) to create your Java source files and then save them to the hard disk. While this technique will work, you won't get the syntax highlighting and colouring that is offered by the Xcode editor.
    Any help would be appreciated. I feel really dumb
    right now. The tutorial only covers how to do this
    in Windows and Solaris.
    I think that if you follow my tutorials you will very quickly get up and running with Java development. I hope you enjoy working with Java as much as I do. You can always come back here if you need more help.
    Bob

  • HT1918 I can't buy anything on I tune forgot my stupid answers on questions

    Change my security  question forgot answers

    Click here for information. If the option to have the answers emailed to you isn't available or doesn't work(the email may take a few hours to arrive), contact the iTunes Store staff via the link in the 'Additional Information' section of that article.
    Without a rescue email address, you can't reset them yourself. Nobody on these boards can reset them for you.
    (93439)

  • Conditional branching questions

    I am so new to this! Downloaded trial version Cp4 to decide if it will work for me before I buy it?
    I would like to design an online questionnaire (more of a survey than a quiz) to acquire demographic data and more.
    How do I design conditional branching?
    (Also, is there a way that the responses can automatically be exported into a predesigned form or report (the various fields in this form populated by the questionnaire responses)??
    Any suggestions will be of help!
    Jan

    Hi there
    And if it helps any, Adobe themselves use Survey Monkey for lots of things!
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Stupid, basic iWeb questions

    Hi all
    A couple of basic questions. I know I could look at the manual, but you lot are so much friendlier.
    So I've created a webpage, published to a folder. How do I load in another, different page/site?
    Can you load in web pages created by another program?
    How do you/can you get rid of the .mac splash screen at startup?
    Regards
    Stephen

    going down your list...
    1) you just make a new site, the old site will still be open, but you can start working on a new site the publish that one to a folder as well....kinda annoying, but that's basically it...
    2) No you can't load pages from another program...that too is kinda annoying
    3) open up your .mac preferences in your system preferences and put in any thing for the login and pass...it'll give you an error about it no being found, but that's the last time you'll have to deal with it...no more splash screen...

  • Stupid but viable question

    My mate has a 30gig ipod and has a 10gig computer hd... he only has used about 4gig on the ipod (meaning 4gig is on the comp as well(of music)) is itpossible to copy his songs to the hd of the ipod (HD mode is enabled) and import the into itunes from his HD.... this will mean potentially he has 8 gig of files, 4gig in which are playable, the other 4 for itunes to understand

    He might be better off getting an external hard drive to hold all the song files.
    It can be risky only holding the song files on only on the iPod - if it is lost, has to be reset, etc he will have a lot of work to get the files back on there.
    But maybe I didn't understand your question.

  • Stupid WHILE loop question

    A=0
    While A<B
    BEGIN
          Set B=B+1
         ...statements
    END
    If B had been = to 1 would the loop process through to the END or exit as soon as B was incremented?

    The best way to learn this would be trying by yourself.
    Hint: Based on what you posted (B = 1) you will need to learn the keyword BREAK.
    AMB
    Some guidelines for posting questions...
    AYÚDANOS A AYUDARTE, guía básica de consejos para formular preguntas

  • Stupid Desktop Display Question

    My friend always wanted to know this, and he doesn't subscribe here:
    Is it possible to automatically align your desktop icons (especially Mac HD) on the Left side of the screen, not the right?
    He's really anal retentive and likes keeping AIM on the right, and doesn't like covering the icons, so wants them to stay on the left.
    Thanks, I know it's a dumb question.

    Boot Camp only supports the usage of Windows XP SP2 or Windows Vista. Use a product such as Parallels Desktop for other Windows versions.
    (26022)

  • Slight Rant - Does iTunes think I'm THAT stupid? (Honest question though)

    Ok... I've been had by iTunes and QT in the past, but this time it just made me flat mad!!
    I came home from work today with a miniDV tape and two board-fed single track 30ish minute audio CDs of vocal auditions I was having. My SIMPLE plan was to take the video into FCP and copy the audio off the CD and line them up for later use.
    Video came off fine (1 hour time)
    Stuck the first CD in - up popped iTunes and I closed it.
    Opened the CD in the finder and drug the audio track to a scratch drive - NO PROBLEM (3 minutes)
    Stuck 2nd CD in - up popped iTunes - My 10 year old screamed for me to come into his room (2 minutes)
    Came back and iTunes had "found" the album this JUST NOW created CD was - and I closed it.
    Opened the CD in the finder and drug the audio track to the scratch drive -- um... er....
    WOULDN'T LET ME!!!!
    It thought this was (honest):
    King's Cross/The Gospel of Mark (Part 1 - The Coming of the King)
    Now... the guy singing was good, but not HOLY good!!
    So - now I've had to spend another 3 minutes writing this AND ripping it thru iTunes!!!! (hee)
    But still -- is this iTunes? Finder? Steve Jobs? RIAA?? Who has their hands in MY audio creations?
    Any way to fix this once my computer is told by iTunes that this is something it isn't?
    CaptM

    itunes searches for CD info by number of tracks on a CD and track duration. Yours had a match, you won!
    When I first saw your topic my thought was that many people think their computer is is potentially capable of delivering a hot cup of tea when you utter your request before beaming down to a new planet, so yes, it does think you are that stupid! Reality is when Picard requests Earl Gray he's really getting mocha espresso in that cup because they still haven't figured out the software bugs in 2300.

  • Simple conditional array question

    Hi -
    I need to create an array, but how big it is depends on some other influences. Here's a simplified version:
    if (dataRequest.equals("elves")){
    String[] arrayLoader={"tinky","winky","pinky","stinky"};
    } else if (dataRequest.equals("reindeer")){
    String[] arrayLoader={"dasher","dancer","rudolph"};
    } else if (dataRequest.equals("villians")){
    String[] arrayLoader={"snowmiser","heatmiser"};
    out.println(arrayLoader.length);When I run this, I get "arrayLoader.length cannot be resolved to a type", but if I put the arrayLoader.length statement within each of the conditional parts, a length is returned. For some reason, the value seems to be "forgotten" by the time I leave the conditional part of the code.
    What am I missing?

    Variables only exist within the block they are declared in. So each of those String arrays only has scope within its own curly braces.
    What you want is an ArrayList.
    http://java.sun.com/javase/6/docs/api/java/util/ArrayList.html
    It's an array that is automatically sized as you add members to it.

Maybe you are looking for